LRESULT CALLBACK invisible_window_msg_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
switch (msg) {
case WM_QUERYENDSESSION: {
/* Okay, the session is about to end! */
printf("waiting...\n");
sleep(3500);
printf("done!\n");
return 0;
}
}
It doesn't get caught, and when I logoff or shutdown, none of the messages print. I read somewhere it has to be a toplevel window for it to get caught... shouldn't WS_OVERLAPPED do the trick?
Question
Patrick_
Hey guys, I'm trying to catch WM_QUERYENDSESSION and WM_ENDSESSION to no avail. I'm creating a window like so:
Here's the function that should catch it:
It doesn't get caught, and when I logoff or shutdown, none of the messages print. I read somewhere it has to be a toplevel window for it to get caught... shouldn't WS_OVERLAPPED do the trick?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts