Exemple #1
0
        public static void GetCurrentSettings()
        {
            DEVMODE mode = new DEVMODE();

            mode.dmSize = (ushort)Marshal.SizeOf(mode);

            if (EnumDisplaySettings(null,
                                    -1,
                                    ref mode) == true) // Succeeded
            {
                Console.WriteLine("Current Mode:\n\t" +
                                  "{0} by {1}, " +
                                  "{2} bit, " +
                                  "{3} degrees, " +
                                  "{4} hertz",
                                  mode.dmPelsWidth,
                                  mode.dmPelsHeight,
                                  mode.dmBitsPerPel,
                                  mode.dmDisplayOrientation * 90,
                                  mode.dmDisplayFrequency);
            }
        }
Exemple #2
0
 public static extern int ChangeDisplaySettings(
     [In, Out]
     ref DEVMODE lpDevMode,
     [param: MarshalAs(UnmanagedType.U4)]
     uint dwflags);