[Win32 API] Set text and background color of static label?

Did some reading but am so far unsuccessful. I am trying to set the background color and text color of a type "STATIC" window. Below is the code and what I've tried.

1
2
3
4
case WM_CREATE:
userLbl = CreateWindowEx(NULL, TEXT("Static"), TEXT("Username: "), WS_CHILD | WS_VISIBLE, 10, 20, 75, 20, hWnd, NULL, NULL, NULL);
		SetTextColor(userLbl, RGB(255, 255, 255));
		SetBkColor(userLbl, RGB(0, 0, 0));


I figured this would work, but no luck so far.
1
2
SetTextColor(userLbl, RGB(255, 255, 255));
SetBkColor(userLbl, RGB(0, 0, 0));
Last edited on
WM_PAINT
Mind expanding a bit on that? I've tried putting the same code inside of the WM_PAINT case with no luck.
All the reading I've done seems to suggest WM_PAINT but still nothing I've looked at has worked.
Topic archived. No new replies allowed.