delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/23/23:12:08

From: curtis AT pdi DOT com (Curtis Galloway)
Subject: Problem with winsup CTRL_LOGOFF_EVENT handler
23 Mar 1998 23:12:08 -0800 :
Message-ID: <35169E72.96A159C3.cygnus.gnu-win32@pdi.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

The exception handler that deals with the Win32 events CTRL_LOGOFF_EVENT,
CTRL_SHUTDOWN_EVENT and CTRL_CLOSE_EVENT seems to not quite do the right
thing.  When shutting down my NT 4.0 system, I get a dialog box for each open
bash window asking me if I want to kill the process or wait for it to shut
down.

This happens because the winsup handler function returns TRUE, which,
according to the MS documentation, signals the OS to bring up this dialog box.

However, if the handler returns FALSE, Win32 will call the other registered
handlers for the event, and the default handler terminates the process, which
may not be what you want.

The doc goes on to say that you can use the SetProcessShutdownParameters
function to prevent the dialog box from being displayed.

My question to the Win32 experts is this: is it better to have the handler
return FALSE, or to use SetProcessShutdownParameters?

--Curtis Galloway
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019