BUG: Some Console Control Events Not Received Under Windows 95

Last reviewed: March 4, 1997
Article ID: Q130717
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95

SYMPTOMS

Console applications call SetConsoleCtrlHandler() to install or remove application-defined callback functions to handle console control signals. Typically, a console window with keyboard focus receives the CTRL_C_EVENT and CTRL_BREAK_EVENT signals when the CTRL+C and CTRL+BREAK keys are pressed or if they are generated using the GenerateConsoleCtrlEvent() function. But the system generates CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT signals when the user closes the console, logs off, or shuts down the system so that the console process has an opportunity to clean up before termination.

On Windows 95, a console application that has installed a control signal handler function only gets called for the CTRL_C_EVENT and CTRL_BREAK_EVENT signals; the signal handler function is never called for the CTRL_SHUTDOWN_EVENT, CTRL_LOGOFF_EVENT, and CTRL_CLOSE_EVENT signals.

Note that this problem does not occur under Windows NT versions 3.51 and 4.0.

CAUSE

The Windows 95 console system sends CTRL_C_EVENT and CTRL_BREAK_EVENT signals to console applications that have installed signal handers, but does not send CTRL_SHUTDOWN_EVENT, CTRL_LOGOFF_EVENT, or CTRL_CLOSE_EVENT signals.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION:

There is also another bug under Windows 95 that affects console applications that have installed a control signal handler. For more information on this bug, please refer to the following Knowledge Base article:

   ARTICLE ID: Q134284
   TITLE     : BUG: Queued Console Control Signals May be Missed under
               Windows 95


Additional query words: Win95 console event signal


Keywords : BseCon kbprg kbbuglist
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.