J
Jose
Hello,
I'm trying to grab the process id based on the window's Hwnd. I can
get the process id correctly, but I can't figure out how to pass that
into TerminateProcess. Assuming the call to GetWindowThreadProcessId()
gets a valid procID, how can I use that to call TerminateProcess? Is
my pinvoke wrong?
[DllImport("coredll")] public static extern uint
GetWindowThreadProcessId(IntPtr hwnd, out uint lpdwProcessId);
[DllImport("coredll")] public static extern int TerminateProcess(IntPtr
procID, uint uExitCode);
uint theProc = 0;
GetWindowThreadProcessId(hwnd, out procID);
I'm trying to grab the process id based on the window's Hwnd. I can
get the process id correctly, but I can't figure out how to pass that
into TerminateProcess. Assuming the call to GetWindowThreadProcessId()
gets a valid procID, how can I use that to call TerminateProcess? Is
my pinvoke wrong?
[DllImport("coredll")] public static extern uint
GetWindowThreadProcessId(IntPtr hwnd, out uint lpdwProcessId);
[DllImport("coredll")] public static extern int TerminateProcess(IntPtr
procID, uint uExitCode);
uint theProc = 0;
GetWindowThreadProcessId(hwnd, out procID);