PDA

Click to See Complete Forum and Search --> : Activating screensaver (power off screen)


jaks
Oct 13th, 2000, 02:28 PM
Is there af way to power off a monitor (energy save) form VB?

I would the screen to 'go black/switch off' when a form is empty, and back on when there is something on the form.

Best wishes
Jakob

Mad Compie
Oct 18th, 2000, 01:44 PM
Yes, SetSystemPowerState does the thing:


Public Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Long, ByVal fForce As Long) As Long
...
SetSystemPowerState(1, 0) 'Power down with prompt
...
SetSystemPowerState(1, 1) 'Power down without prompting


It could take some time to recover from power-down to normal state.