Esempio n. 1
0
        public static bool Rotate(uint DisplayNumber, Orientations Orientation)
        {
            if (DisplayNumber == 0)
            {
                throw new ArgumentOutOfRangeException("DisplayNumber", DisplayNumber, "First display is 1.");
            }

            bool           result = false;
            DISPLAY_DEVICE d      = new DISPLAY_DEVICE();
            DEVMODE        dm     = new DEVMODE();

            d.cb = Marshal.SizeOf(d);

            if (!NativeMethods.EnumDisplayDevices(null, DisplayNumber - 1, ref d, 0))
            {
                throw new ArgumentOutOfRangeException("DisplayNumber", DisplayNumber, "Number is greater than connected displays.");
            }
            return(Rotate(d.DeviceName, Orientation));
        }
Esempio n. 2
0
 internal static extern int EnumDisplaySettings(
     string lpszDeviceName, int iModeNum, ref DEVMODE lpDevMode);
Esempio n. 3
0
 internal static extern DISP_CHANGE ChangeDisplaySettingsEx(
     string lpszDeviceName, ref DEVMODE lpDevMode, IntPtr hwnd,
     DisplaySettingsFlags dwflags, IntPtr lParam);