I have a static control:
HWND hLabelControl=CreateWindowEx(WS_EX_CLIENTEDGE,"STATIC","",
WS_TABSTOP|WS_VISIBLE|WS_CHILD|SS_CENTER,0,0,24,24,
hwnd,(HMENU)hS1,GetModuleHandle(NULL),NULL);
I want when a button is pressed the color of the text in the static label to change to red for example.
How can I do this?
I know there is a
SetTextColor(
_In_ HDC hdc,
_In_ COLORREF crColor
);
function but I can't figure out how to get the HDC of the static control.
Thanks in advance.
EDIT:
This doesn't work:
HDC hDC=GetDC(hLabelControl);
SetTextColor(hDC,RGB(255,0,0));
WM_PAINT
message. – Spiritism