CreateWindowEx works once, but not twice...
I don't understand why it's not working for AdultWnd but for BabyWnd it does:
Code:
AdultWnd = CreateWindowEx ( WS_EX_APPWINDOW,
ClassName,
WindowTitle,
WS_POPUP,
CW_USEDEFAULT,
CW_USEDEFAULT,
WindowRect.right + 10,
WindowRect.bottom + TitleHeight + ArcSize + 5,
0,
NULL,
(HINSTANCE)hInstance,
NULL );
if (!AdultWnd) MessageBox ( Windo, "The AdultWnd was not created!", "AdultWnd", MB_OK );
BabyWnd = CreateWindowEx ( WS_EX_APPWINDOW,
ClassMini,
WindowTitle,
WS_POPUP,
5,
TitleHeight + 5,
WindowRect.right - 10,
WindowRect.bottom - ArcSize - TitleHeight - 5,
GetDesktopWindow (),
NULL,
(HINSTANCE)hInstance,
NULL );
BabyWnd works, but not AdultWnd... The registering class thingy is like this:
Code:
wc.cbClsExtra = 0;
wc.cbSize = sizeof(WNDCLASSEX);
wc.cbWndExtra = 0;
wc.hbrBackground= (HBRUSH)GetStockObject ( GRAY_BRUSH ); //(HBRUSH)(TestBrush);
wc.hCursor = LoadCursor ( NULL, IDC_ARROW );
wc.hIcon = 0;
wc.hIconSm = 0;
wc.hInstance = (HINSTANCE)hModule;
wc.lpfnWndProc = (WNDPROC)WindoProc;
wc.lpszClassName = ClassName;
wc.lpszMenuName = "\0";
wc.style = CS_HREDRAW | CS_VREDRAW;
RetVal = (long)RegisterClassEx ( &wc );
if ( RetVal == 0 ) MessageBox ( GetDesktopWindow (), "Adult class not created!", "Warning!", MB_OK);
wc.lpfnWndProc = (WNDPROC)MiniWindoProc;
wc.lpszClassName = ClassMini;
RetVal = (long)RegisterClassEx ( &wc );
if ( RetVal == 0 ) MessageBox ( GetDesktopWindow (), "Child class not created!", "Warning!", MB_OK);
hInstance = hModule;