public static IntPtr GetProcessForWindow(IntPtr windowHandle)
        {
            IntPtr processId;
            IntPtr threadId = NativeUtils.GetWindowThreadProcessId(windowHandle, out processId);

            return(processId);
        }
        public static Point NativeScreenToClient(IntPtr window, Point originalPoint)
        {
            POINT point = new POINT(originalPoint.X, originalPoint.Y);

            if (NativeUtils.ScreenToClient(window, ref point))
            {
                return(new Point(point.x, point.y));
            }
            return(Point.Empty);
        }
        public override void OnInstallHook(byte[] data)
        {
            base.OnInstallHook(data);

            ObjectEditor.Instance.EnableHotKey();

            IntPtr originalHawkeyeWindow = (IntPtr)BitConverter.ToInt32(data, 0);
            IntPtr spyWindow             = (IntPtr)BitConverter.ToInt32(data, 4);

            ObjectEditor.Instance.Show();
            ObjectEditor.Instance.ActiveEditor.SelectedWindowHandle = spyWindow;

            // close original window
            NativeUtils.SendMessage(originalHawkeyeWindow, 0x0010, IntPtr.Zero, IntPtr.Zero);             // close
        }
 public static void GetWindowThreadAndProcess(IntPtr windowHandle, out IntPtr threadId, out IntPtr processId)
 {
     threadId = NativeUtils.GetWindowThreadProcessId(windowHandle, out processId);
 }