Discussion:
WM_CTLCOLORSTATIC with NULL_BRUSH has trouble on Vista Aero
(too old to reply)
Microsoft Newsgroup
2007-12-01 23:11:15 UTC
Permalink
I created a transparent dialogbox. To make the static text control in the
dialgbox to be transparent, I processed the WM_CTLCOLORSTATIC with the code
like this:

case WM_CTLCOLORSTATIC:
{
HDC hdc=(HDC)wParam;

SetBkMode(hdc, TRANSPARENT);
}
return (INT_PTR)GetStockObject(NULL_BRUSH);

This worked very well on Win98, Win2000, WinXP and even on Windows Vista
without Aero.

But, if the Aero is turned on, strange thing happens.

The static control turns into a black block. It seems that NULL_BRUSH does
not work in its usual way.

Does anybody know how to fix this? I do not want to turn off the Aero by
force in my program.

Thanks a lot in advance.

Henry Fish
Sam Hobbs
2007-12-02 19:17:27 UTC
Permalink
This exact same question was also asked in the
microsoft.public.win32.programmer.ui newsgroup approximately three hours
earlier.
Post by Microsoft Newsgroup
I created a transparent dialogbox. To make the static text control in the
dialgbox to be transparent, I processed the WM_CTLCOLORSTATIC with the code
{
HDC hdc=(HDC)wParam;
SetBkMode(hdc, TRANSPARENT);
}
return (INT_PTR)GetStockObject(NULL_BRUSH);
This worked very well on Win98, Win2000, WinXP and even on Windows Vista
without Aero.
But, if the Aero is turned on, strange thing happens.
The static control turns into a black block. It seems that NULL_BRUSH does
not work in its usual way.
Does anybody know how to fix this? I do not want to turn off the Aero by
force in my program.
Thanks a lot in advance.
Henry Fish
Loading...