Im kind confuse about how PostQuitMessage works..
Im using like this:
case WM_CLOSE : DestroyWindow( hWnd ); break; //send WM_DESTROY
case WM_DESTROY : CleanUp();
gsp_quit = true;
PostQuitMessage( 0 ); //send WM_QUIT
break;
That is on my WndProc function.
My message loop is like that:
while ( !gsp_quit ){
if( PeekMessage( &gsp_msg, NULL, NULL, NULL, PM_REMOVE ) ){
TranslateMessage( &gsp_msg );
DispatchMessage ( &gsp_msg );
}//while F PeekMessage()
}//F while !gsp_quit
//***
return gsp_msg.wParam;//it should return 0
The problem is that it just returns 0 (zero) if I use while( PeekMessage() ) instead of 'If', or if I call PeekMessage again at //***
So, i guess theres some overheads on PostQuitMessage before it send your exit code given on its param..what are those overheads?
And where can I search for exit codes info? I was trying to find it at MSDN but I didnt..