Text In Win32

How can I create text with a gray background? I changed the default white background color in win32 applications from: wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); to: wc.hbrBackground = (HBRUSH)(COLOR_WINDOW); So now I have a gray background (what I wanted :)) but now the my text is on top of white boxes? I draw text like this in the windows procedure:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_CLOSE:
		DestroyWindow(hwnd);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case WM_PAINT:
		{
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint( hwnd, &ps );
			TextOut( hdc, 75 /* X */, 0 /* Y */, "***IMPORTANT***", 15 /* Number of chars */);
			TextOut( hdc, 0 /* X */, 30 /* Y */, "Do Not Close This Window", 30 /* Number of chars */);
			TextOut( hdc, 0 /* X */, 60 /* Y */, "Press Delete Key To Turn Off Then Close", 40 /* Number of chars */);
			EndPaint( hwnd, &ps );
		}
		break;
	default:
		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
	return 0;
}
How can I draw text that would match the background color?
Check out the SetBkColor() function --

http://msdn.microsoft.com/en-us/library/dd162964(VS.85).aspx
Topic archived. No new replies allowed.