Board index » delphi » Finding the ctl3d background brush (under w95)

Finding the ctl3d background brush (under w95)

Hi.  I have a TDialog which creates a TWindow descendant, with a hbrbackground
of getstockobject( ltgray_brush ).  However, when I run it under w95 (it uses
ctl3d), the control color is sometimes different - gray instead of light gray,
for example - under some schemes.  How can I get the brush to use for my
Window?  It's a win3.1 app, BTW.. I presume something can be done using
the ctl3d functions, I notice that one of them returns a brush, but it
expects a message (wm_ctlcolor, I guess).. what do I do?

Thanks,
will.
--

Will Bryant
brya...@freenet.hut.fi
brya...@winston.riccarton.school.nz

 

Re:Finding the ctl3d background brush (under w95)


In article <4t6q1r$...@freenet.hut.fi>,
brya...@mail.freenet.hut.fi (Will Bryant,Christchurch New Zealand) says:

Quote
>Hi.  I have a TDialog which creates a TWindow descendant, with a hbrbackground
>of getstockobject( ltgray_brush ).  However, when I run it under w95 (it uses
>ctl3d), the control color is sometimes different - gray instead of light gray,
>for example - under some schemes.  How can I get the brush to use for my
>Window?  It's a win3.1 app, BTW.. I presume something can be done using
>the ctl3d functions, I notice that one of them returns a brush, but it
>expects a message (wm_ctlcolor, I guess).. what do I do?

Use GetSysColor when obtaining 3D colors, since CTL3DV2.DLL does the same.
Ask the button colors. Note that this goes for Win3.1 as well, try changing
the button color settings.

When you've got the color, do CreateSolidBrush and don't forget to call
DeleteObject when done.

Bye,
Zweitze.

-----------------------------------------------------------------------
  Zweitze de Vries                           zwei...@cyco.nl
  Cyco Software Development
  Handelskade 49
  Rijswijk, Netherlands                      (+31) 70 3954179

Other Threads