c++ - Win32 - Color static text (WM_CTLCOLORSTATIC) -
i have code
bool callback msgproc(hwnd hwnd, uint message, wparam wparam, lparam lparam { static hbrush hbrush = getsyscolorbrush(color_btnface); switch(message) { ... case wm_ctlcolorstatic: hdc hdc = (hdc) wparam; // updated setbkmode(hdc,transparent); if(getwindowlong(hwnd, gwl_id ) == idc_radio_excellent) { // dark green. settextcolor(hdc,rgb(0,0x64,0)); } return (lresult) hbrush; case ... } }
i'm trying color static text darkgreen. sure, settextcolor called.
everything ok when use:
#pragma comment(linker,"\"/manifestdependency:type='win32' \ name='microsoft.windows.common-controls' version='6.0.0.0' \ processorarchitecture='*' publickeytoken='6595b64144ccf1df' language='*'\"")
then static text not dark green black.
what doing wrong?
solution
i found solution works me. set off visual style radio button in wm_initdialog dialog.
setwindowtheme(getdlgitem(hwnd, idc_radio_excellent), l"", l"");
Comments
Post a Comment