public static int ScreenY(IntPtr hWnd) { IntPtr handle = NativeMethods.MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST); MONITORINFOEX info = new MONITORINFOEX(); NativeMethods.GetMonitorInfo(handle, info); return(info.rcMonitor.bottom - info.rcMonitor.top); }
internal static extern bool GetMonitorInfo(IntPtr hmonitor, [In, Out] MONITORINFOEX info);