• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Disable monitor power off

I'm working in VB6 and I need to disable the monitor from powering off, as set in the power control applet of control panel, preferably through an API.
This is NOT a query to disable the screen saver, nor do I need to know how to turn the monitor on and off.
0
KenSowton
Asked:
KenSowton
  • 2
1 Solution
 
syntaxmishapCommented:
With your API declares:

Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long


Function call to disable automatic power off of the display:

Call SystemParametersInfo(82, 1200, 0, &H1)


Let me know if you have any questions,
syntaxmishap
0
 
syntaxmishapCommented:
Call SystemParametersInfo(82, 0, 0, &H1)

Sorry about that - the 1200 should have been 0. I had changed my timeout back to default before copying and pasting the reply.

syntaxmishap
0
 
KenSowtonAuthor Commented:
yes, that works.
Unfortunately the system standby now kicks in a while later.
I'm going to accept your answer anyway, Do you know how to suspend standby (and thus presumeably Hibernate).
if you do I'll increase the points before I accept.
Thanks.
KenSowton
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now