public static VideoPowerState GetVideoPowerState() { IntPtr hdc = GetDC(IntPtr.Zero); VideoPowerManagement ret = new VideoPowerManagement(); ExtEscape(hdc, GETPOWERMANAGEMENT, 0, IntPtr.Zero, 12, ref ret); return(ret.PowerState); }
public static void SetVideoPowerState(VideoPowerState value) { IntPtr hdc = GetDC(IntPtr.Zero); VideoPowerManagement vpm = new VideoPowerManagement { Length = 12, DPMSVersion = 1, PowerState = value }; ExtEscape(hdc, SETPOWERMANAGEMENT, vpm.Length, ref vpm, 0, IntPtr.Zero); }
static extern int ExtEscape(IntPtr hdc, int nEscape, int zero, IntPtr empty, int cbOutput, ref VideoPowerManagement outData);
static extern int ExtEscape(IntPtr hdc, int nEscape, int cbInput, ref VideoPowerManagement vpm, int zero, IntPtr empty);
public static VideoPowerState GetVideoPowerState() { IntPtr hdc = GetDC(IntPtr.Zero); VideoPowerManagement ret = new VideoPowerManagement(); ExtEscape(hdc, GETPOWERMANAGEMENT, 0, IntPtr.Zero, 12, ref ret); return ret.PowerState; }
extern static int ExtEscape(IntPtr hdc, int nEscape, int zero, IntPtr empty, int cbOutput, ref VideoPowerManagement outData);
extern static int ExtEscape(IntPtr hdc, int nEscape, int cbInput, ref VideoPowerManagement vpm, int zero, IntPtr empty);