windows - a nonresponsive program, doesn't end gracefully when asked to terminate, for testing -
i want write simple program nothing not terminate when asked to. want see windows dialog box says, "this program not responsive, want wait let finish it's doing, or terminate now?". after user chooses "terminate now", should, of course, exit.
the reason want testing environment. want test scenario in user trying log out, system doesn't log them out right away, because of unresponsive program.
i tried responding wm_destroy calling sleep(), doesn't seem it. program still terminates when killed task manager. again, i'm not trying write "unkillable", simple program makes dialog box come asking if user wants wait program finish.
thanks help.
you can try modifying main-message loop . use peekmessage(...) no_remove , ignore wm_quit messages
edit: remove every message (except wm_quit) before processing (getmessage( &msg ,msg.hwnd ,msg.message ,msg.message ))
Comments
Post a Comment