?? sigtest.cpp
字號:
#include <windows.h>
#include <stdio.h>
#include <signal.h>
//
// sigtest.cpp. Test program for signal handling.
// compile this program with the following command line
//
// cl -GX sigtest.cpp user32.lib
//
// The -GX enables exception handling. The user32.lib
// provides the MessageBox function.
//
//
// Prototype for signal handler
//
void _cdecl HandleAbort (int sig);
//
// Save the old signal function if any
//
void (*func)(int sig);
main ()
{
func = signal (SIGABRT, HandleAbort);
throw;
MessageBox (NULL, "Abort handled", "Abort", MB_OK);
}
void _cdecl HandleAbort (int sig)
{
MessageBox (NULL, "Handling abort", "Abort", MB_OK);
if (func != NULL)
func(sig);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -