コード例 #1
0
        private static List<MonitorInfoEx> GetDisplays()
        {
            var result = new List<MonitorInfoEx>();

            Methods.EnumDisplayMonitors(
                IntPtr.Zero,
                IntPtr.Zero,
                (IntPtr hMonitor, IntPtr hdcMonitor, ref Rectangle lprcMonitor, IntPtr dwData) =>
                {
                    var mi = new MonitorInfoEx().Initialize();
                    var success = Methods.GetMonitorInfo(hMonitor, ref mi);
                    if (success)
                    {
                        result.Add(mi);
                    }
                    return true;
                },
                IntPtr.Zero);
            return result;
        }
コード例 #2
0
 public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfoEx lpmi);