Disable monitor power off

Posted on 2004-11-27
Last Modified: 2008-03-17
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.
Question by:KenSowton
    LVL 1

    Expert Comment

    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,
    LVL 1

    Accepted Solution

    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.


    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now