I'm trying to change the color of a static control from blue to purple.
I managed to change it to blue in the dialog initialization but I can't change it to purple after.
Here's the working blue color code:
And here's the not working purple color code:Code:switch(uMsg) { case WM_CTLCOLORSTATIC://wParam: Handle to the device context for the static control window. //lParam: Handle to the static control. { if ((HWND)lParam == GetDlgItem(hwndDlg,IDC_STATIC3)) { SetBkMode((HDC)wParam,TRANSPARENT); SetTextColor((HDC)wParam, RGB(0,0,255)); return (BOOL)CreateSolidBrush (GetSysColor(COLOR_MENU)); } } }
thanksCode:switch(uMsg) { case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_STATIC3: { SetTextColor((HDC)GetDC(GetDlgItem(hwndDlg, IDC_STATIC3)), RGB(145,25,139)); return (BOOL)CreateSolidBrush (GetSysColor(COLOR_MENU));//is this needed? } }


Reply With Quote

Bookmarks