VC关闭当前进程

MessageBox("进程即将关闭");
DWORD processid=::GetCurrentProcessId();
HANDLE hProcess=::OpenProcess(PROCESS_TERMINATE,FALSE,processid);
::TerminateProcess(hProcess,0);
CloseHandle(hProcess);



转帖:http://hi.baidu.com/iorlhu/blog/item/7a0f3c0296378c83d53f7c15.html

你可能感兴趣的:(c)