LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
// WndGlobals WinGlobals ;
}
case WM_CLOSE:
DestroyWindow(hwnd) ;
break ;
case WM_DESTROY:
PostQuitMessage(0) ;
break ;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
Edited by - da_cobra on March 3, 2002 11:53:41 AM
simple question (I think) :D
I have a simple question (I think)
I have the following procedure before my winmain
and I just create a simple window
now when I add that WM_CREATE, my application immediatly exits
and if I leave that WM_CREATE out of my procedure it displays my window normal, how does this come?
You're falling through the cases from WM_CREATE to WM_CLOSE and that's causing the window to close as soon as it's created. Put a break where indicated you should be ok.
Edited by - lessbread on March 3, 2002 12:04:15 PM
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){ switch(msg) { case WM_CREATE: { // WndGlobals WinGlobals ; }// PUT A BREAK HEREbreak; case WM_CLOSE: DestroyWindow(hwnd) ; break ; case WM_DESTROY: PostQuitMessage(0) ; break ; default: break ; } return DefWindowProc(hwnd, msg, wParam, lParam);}
Edited by - lessbread on March 3, 2002 12:04:15 PM
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement