From 09863d920b1fb75087b1f7b19d7ae7b782d8f88b Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 5 Oct 2014 18:36:32 +0100 Subject: [PATCH] [Refs #87: Static Analysis] Fix P/Invoke - C# point varies on x86/x64 --- renderdocui/Code/Win32PInvoke.cs | 2 +- renderdocui/Windows/MainWindow.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) {