public static int GetWindowProcessId(IntPtr hwnd) { int num; GetWindowThreadProcessId(hwnd, out num); return num; }