private extern static uint GetWindowThreadProcessId(IntPtr hWnd, out IntPtr lpdwProcessId); [DllImport("user32")]