Discussion:
WM_CTLCOLORSTATIC on Vista Aero
(too old to reply)
Hery Fish
2007-12-01 20:08:33 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:16 UTC
Permalink
This exact same question was also asked in the
microsoft.public.platformsdk.ui newsgroup approximately three hours later.
Post by Hery Fish
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
Hery Fish
2007-12-02 21:15:13 UTC
Permalink
Yes. That is also me. Just want the problem get resolved.
Is that forbiden? I will be sorry about that.
Post by Sam Hobbs
This exact same question was also asked in the
microsoft.public.platformsdk.ui newsgroup approximately three hours later.
Post by Hery Fish
I created a transparent dialogbox. To make the static text control in the
dialgbox to be transparent, I processed the WM_CTLCOLORSTATIC with the
{
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-03 18:33:34 UTC
Permalink
It is highly appreciated by people that answer questions that people don't
ask the same question in multiple places at the same time in a manner that
prevents people from seeing other answers. The reason is that if the
question gets answered in one place then people won't see that answer in the
other places. Then if they take the time to help you eventhough you already
have an answer then you waste the time of the people trying to help you.

If you feel you must post the same question in multiple places, then you can
"crosspost", in which you provide multiple recipient newsgroups for a single
message, similar to when you provide multiple "To" addresses for email. I
don't know the details of how to do that; it depends on your software.

This question actually needs to be posted in one place.
Post by Hery Fish
Yes. That is also me. Just want the problem get resolved.
Is that forbiden? I will be sorry about that.
Post by Sam Hobbs
This exact same question was also asked in the
microsoft.public.platformsdk.ui newsgroup approximately three hours later.
Post by Hery Fish
I created a transparent dialogbox. To make the static text control in the
dialgbox to be transparent, I processed the WM_CTLCOLORSTATIC with the
{
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
Hery Fish
2007-12-04 18:46:08 UTC
Permalink
Thank you for tell me that.

Still want the problem get answered here.

That does not happen on specific software. You can just create a simpel
hello application. It just happens.

I am just wondering whether that is a bug of Vista Aero.
Post by Sam Hobbs
It is highly appreciated by people that answer questions that people don't
ask the same question in multiple places at the same time in a manner that
prevents people from seeing other answers. The reason is that if the
question gets answered in one place then people won't see that answer in
the other places. Then if they take the time to help you eventhough you
already have an answer then you waste the time of the people trying to
help you.
If you feel you must post the same question in multiple places, then you
can "crosspost", in which you provide multiple recipient newsgroups for a
single message, similar to when you provide multiple "To" addresses for
email. I don't know the details of how to do that; it depends on your
software.
This question actually needs to be posted in one place.
Post by Hery Fish
Yes. That is also me. Just want the problem get resolved.
Is that forbiden? I will be sorry about that.
Post by Sam Hobbs
This exact same question was also asked in the
microsoft.public.platformsdk.ui newsgroup approximately three hours later.
Post by Hery Fish
I created a transparent dialogbox. To make the static text control in
the dialgbox to be transparent, I processed the WM_CTLCOLORSTATIC with
{
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...