[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern int GetWindowThreadProcessId(HandleRef handle, out int processId); public static int GetRealProcessID(IntPtr WindowHandle) { int parentProcessId; GetWindowThreadProcessId(new HandleRef(null, WindowHandle), out parentProcessId); return parentProcessId; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)