mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Fix WindowFromPoint P/Invoke
This commit is contained in:
@@ -36,9 +36,22 @@ namespace renderdocui.Code
|
||||
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern IntPtr LoadLibrary(string lpFileName);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct POINT
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public POINT(int x, int y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
}
|
||||
}
|
||||
|
||||
// for redirecting mousewheel
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr WindowFromPoint(int xPoint, int yPoint);
|
||||
public static extern IntPtr WindowFromPoint(POINT pt);
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr SendMessage(IntPtr wnd, int msg, IntPtr wp, IntPtr lp);
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ namespace renderdocui.Windows
|
||||
short x = (short)((pos >> 0) & 0xffff);
|
||||
short y = (short)((pos >> 16) & 0xffff);
|
||||
|
||||
IntPtr wnd = Win32PInvoke.WindowFromPoint((int)x, (int)y);
|
||||
Win32PInvoke.POINT pt = new Win32PInvoke.POINT((int)x, (int)y);
|
||||
|
||||
IntPtr wnd = Win32PInvoke.WindowFromPoint(pt);
|
||||
|
||||
if (wnd != IntPtr.Zero && wnd != m.HWnd && Control.FromHandle(wnd) != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user