![]() |
Problem with windows shutdown
I'm having a hard time to handle the WM_QUERYENDSESSION and WM_ENDSESSION messages correctly.
I'm always ready to shutdown so I always return TRUE to WM_QUERYENDSESSION. In WM_ENDSESSION I perform some cleanup and then post the WM_QUIT message. The problem with my code is that it will shutdown on WM_ENDSESSION and my process is cleanly terminated but for some reason my application interrupts the windows shutdown sequence and the system will not shutdown. The system will shutdown smoothly on the second attempt (when my process is already dead). What am I doing wrong? The code: Code:
int APIENTRY WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, int nCmdShow) |
Re: Problem with windows shutdown
I found a solution and posted it into another forum:
http://www.codeguru.com/forum/showthread.php?t=442396 |
| All times are GMT +5.5. The time now is 02:12. |