小弟我根据句柄杀掉进程,t 有值可为什么返回的k总是0呢,望各位大哥解小弟心中之疑惑。
代码如下:
[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);
IntPtr t = new IntPtr(excel.Hwnd);
int k = 0;
GetWindowThreadProcessId(t,out k);
System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(k);
p.Kill();
...全文
1166打赏收藏
杀掉进程
小弟我根据句柄杀掉进程,t 有值可为什么返回的k总是0呢,望各位大哥解小弟心中之疑惑。 代码如下: [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID); IntPtr t = new IntPtr(excel.Hwnd); int k = 0; GetWindowThreadProcessId(t,o