diff --git a/renderdocui/Code/Win32PInvoke.cs b/renderdocui/Code/Win32PInvoke.cs index 16b53365c..b51326418 100644 --- a/renderdocui/Code/Win32PInvoke.cs +++ b/renderdocui/Code/Win32PInvoke.cs @@ -38,7 +38,7 @@ namespace renderdocui.Code // for redirecting mousewheel [DllImport("user32.dll")] - public static extern IntPtr WindowFromPoint(System.Drawing.Point pt); + public static extern IntPtr WindowFromPoint(int xPoint, int yPoint); [DllImport("user32.dll")] public static extern IntPtr SendMessage(IntPtr wnd, int msg, IntPtr wp, IntPtr lp); diff --git a/renderdocui/Windows/MainWindow.cs b/renderdocui/Windows/MainWindow.cs index 61ca1a471..8d221aa9a 100644 --- a/renderdocui/Windows/MainWindow.cs +++ b/renderdocui/Windows/MainWindow.cs @@ -51,7 +51,7 @@ namespace renderdocui.Windows short x = (short)((pos >> 0) & 0xffff); short y = (short)((pos >> 16) & 0xffff); - IntPtr wnd = Win32PInvoke.WindowFromPoint(new Point(x, y)); + IntPtr wnd = Win32PInvoke.WindowFromPoint((int)x, (int)y); if (wnd != IntPtr.Zero && wnd != m.HWnd && Control.FromHandle(wnd) != null) {