Hello,
ists me again
I want to change the backgroundcolor of my window.
I tried the following code:
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
{
WNDCLASS wc;
ghInstance = hInstance;
if (!GetClassInfo(NULL, L"Dialog", &wc))
return 0;
HBRUSH MyBrush = CreateSolidBrush((COLORREF) RGB (10,10,10) );
wc.hInstance = hInstance;
wc.style = CS_HREDRAW | CS_VREDRAW;
//wc.cbClsExtra = 0;
//wc.cbWndExtra = 0;
wc.hCursor = 0;
wc.lpszMenuName = 0;
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN));
wc.lpszClassName = L"Desktop";
wc.hbrBackground = MyBrush;
if (!RegisterClass(&wc))
return 0;
HWND hWnd = CreateWindow(L"Desktop",
L"Desktop.Class",
WS_CLIPCHILDREN,
0,
0,
240,
136,
NULL,
NULL,
hInstance,
NULL);
ShowWindow (hWnd, nCmdShow);
UpdateWindow (hWnd);
Sleep(10000);
return 0;
}
nothing happens, alos I use:
wc.hbrBackground = GetStockObject(GRAY_BRUSH);
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
tried severall thing, only if I include this
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
I can se how black and white vertical lines come to the display... and I must rebott the wince device.
Whats wrong on the code? Or Perhaps does this not work with WinCe?
Michael