Frank wrote:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK
to shutdown.
While he's thinking about it, Windows displays a box saying the program is
not responding, and if not answered shuts down my program.
Responding usually means processing messages.
I need to delay that while until the user answers my program's dialog box.
How does Windows check to see if an app is responding.
I think it fires messages to the window and waits for a response. No
response within a reasonable period == not responding. In this case, the
message is WM_QUERYENDSESSION, and that's a problem for you I think,
since the whole point is that you need to delay responding to that
message until later.
Can I either make windows satisfied that my program is responding
or specify a longer time before it displays its box
or increase the time its box is displayed before it automatically shuts down
my app?
One solution is to respond immediately to the WM_QUERYENDSESSION by
returning FALSE (abort shutdown), and then initiate the same kind of
shutdown that had already been initiated once the user has responded to
your message (actually, I'm not sure whether you can work out whether it
was a restart or a plain shutdown).
I don't know of a way to change the OS delay you mention - there may be
a registry key somewhere for it.
Tom