/// <summary> /// Gets monitor information for the provided window handle /// </summary> /// <param name="windowHandle">window handle</param> /// <param name="monitorInfo">monitor info</param> internal static void GetMonitorInfoForWindowHandle(IntPtr windowHandle, ref MonitorInfoEx monitorInfo) { var hMonitor = MonitorFromWindow(windowHandle, MONITOR_DEFAULTTONEAREST); GetMonitorInfo(hMonitor, ref monitorInfo); }
private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfoEx lpmi);