Here is my code:
void signalHandler(int sigNum) {
OutputDebugStringA("i'm terminated\n");
exit(sigNum);
}
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow)
{
signal(SIGTERM, signalHandler);
while (1)
{
Sleep(100);
}
return 0;
}
when i terminated it via the windows taskmgr,that DebugString did't show up. is something wrong with my code?
Windows does not use signals in the same way that Unix systems do.
For example, it does not generate SIGTERM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With