|
我用C#下的,获取的进程ID来结束进程.但还是无法关闭
IntPtr PID=PostMessage(PID, 16, 0, 0);
IntPtr hp=Process.OpenProcess(Process.PROCESS_ALL_ACCESS, false,PID.ToInt32());
MessageBox.Show(string.Format ("PID:{0},HP:{1}", PID, hp));
int i = Process.WaitForSingleObject(hp, 5000);
MessageBox.Show(i.ToString ());
bool b=Process.TerminateProcess(hp, 0);
int errCode = Process.GetLastError();
MessageBox.Show(errCode.ToString());
UInt32 exitCode;
Process.GetExitCodeProcess(hp, out exitCode);
MessageBox.Show(exitCode.ToString());
|
|