Original Post
Hello all. Is it possible to create a window in win32 without windowprocedure? Everything works fine, and there is a empty winproc in program, but I'm just curious is it possible (and it is a little bit anoying that there is a procedure in program that do nothing [smile]). I tried to pass 0 parameter, but program report error. Any idea?
winClass.lpszClassName = "MY_WINDOWS_CLASS";
winClass.cbSize = sizeof(WNDCLASSEX);
winClass.style = CS_HREDRAW | CS_VREDRAW;
// I don't need this
winClass.lpfnWndProc = MsgProc;
winClass.hInstance = g_hInstance;
winClass.hIcon = LoadIcon(g_hInstance, (LPCTSTR)IDI_ICON);
winClass.hIconSm = LoadIcon(g_hInstance, (LPCTSTR)IDI_ICON);
winClass.hCursor = LoadCursor(NULL, IDC_ARROW);
winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winClass.lpszMenuName = NULL;
winClass.cbClsExtra = 0;
winClass.cbWndExtra = 0;
if( !RegisterClassEx(&winClass) )
return false;
g_hWnd = CreateWindowEx( NULL, "MY_WINDOWS_CLASS",
"Myprg",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, scrHe480ight, NULL, NULL, g_hInstance, NULL );