procedure KillSelf;
begin
Sleep(1000);
if not TerminateProcess(GetCurrentProcessId, 0) then
WinExec(PChar('TaskKill /F /PID ' + inttostr(GetCurrentProcessId)), SW_SHOWMINIMIZED);
end;
无论是否有线程在运行都一样杀
http://blog.csdn.net/y281252548/article/details/51596132