📄 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 + -