Exemplo n.º 1
0
 public void SetupMonitors()
 {
     monitors.Clear();
     if (NativeCalls.EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, Callb, 0))
     {
         Console.WriteLine("You have {0} monitors", monCount);
     }
     else
     {
         Console.WriteLine("An error occured while enumerating monitors");
     }
 }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            if (!args.Any())
            {
                new Application().Run(new MainWindow());
            }

            if (args[0] == "list")
            {
                var monitors = NativeCalls.EnumDisplayMonitors();
                foreach (var monitor in monitors)
                {
                    Console.WriteLine($"{monitor.DeviceName}: {monitor.Monitor.Width}x{monitor.Monitor.Height}");
                }
                Console.ReadKey();
            }


            return(0);
        }