Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WM_CTLCOLORSTATIC does not work

Status
Not open for further replies.

DeCoDeR

Programmer
Jun 4, 2002
37
US
Hi,
i have a dialog and a static text on the dialog. when i create the static on the dialog, the background for the static text is different so i capture WM_CTLCOLORSTATIC message and coded like below but still it does not work.
any ideas?
==========
hCaption1 is the handle of the static control
==========
case WM_CTLCOLORSTATIC:
hwndtemp = (HWND)lParam;
hdc = (HDC)wParam;

if(hwndtemp == hCaption1)
{
SetTextColor(hdc,RGB(0,255,255));
SetBkColor(hdc,RGB(0,0,0));

}
break;
 
If it really must be net WM_CTLCOLOREDIT, try so:
case WM_CTLCOLORSTATIC:
hwndtemp = (HWND)lParam;
hdc = (HDC)wParam;

if(hwndtemp == hCaption1)
{
SetTextColor(hdc,RGB(0,255,255));
SetBkColor(hdc,RGB(0,0,0));
return (BOOL)GetStockObject(NULL_BRUSH); //Or COLOR_BACKGROUND or what You wish...
}
break;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top