BUG: Some Console Control Events Not Received Under Windows 95 (130717)
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API), when used with:
- the operating system: Microsoft Windows 95
- the operating system: Microsoft Windows 98
- the operating system: Microsoft Windows Millennium Edition
This article was previously published under Q130717 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.
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:
134284
BUG: Queued Console Control Signals May be Missed under
Windows 95
Modification Type: | Minor | Last Reviewed: | 9/27/2004 |
---|
Keywords: | kbbug kbConsole kbKernBase kbProgramming KB130717 |
---|
|