Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Thursday, March 17, 2005

WM_CTLCOLORSTATIC change text color

ON_MESSAGE(WM_CTLCOLORSTATIC,OnCtrlColorStatic)

LRESULT CxxxDlg::OnCtrlColorStatic( WPARAM w, LPARAM p)
{
LRESULT lr = DefWindowProc(WM_CTLCOLORSTATIC,w,p);
HDC hdc = reinterpret_cast(w);
HWND hstatic = reinterpret_cast(p);
if(::GetDlgCtrlID(hstatic)==IDS_SERVER_NAME)
{
SetTextColor(hdc,RGB(255,0,0));
SetBkMode(hdc,TRANSPARENT);
}
return lr;
}

0 Comments:

Post a Comment

<< Home