Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to put off MONITOR or make it Stand By

Posted on 1999-07-27
17
Medium Priority
?
160 Views
Last Modified: 2010-04-04
How can i PUt off the Monitor or make it Standby (saving energy)?  What is a good command for that in Delphi?
0
Comment
Question by:ryan_sabarre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
17 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1391483
good function would be,,,

SystemParametersInfo()

use it with,,

SPI_SETLOWPOWERACTIVE----->

Windows 95 only: Activates or deactivates the low-power phase of screen saving. Set uiParam to 1 to activate, or 0 to deactivate. The pvParam parameter must be NULL.

SPI_SETLOWPOWERTIMEOUT--->

Windows 95 only: Retrieves the time-out value, in seconds, for the low-power phase of screen saving. The uiParam parameter specifies the new value. The pvParam parameter must be NULL.

first set the low power and then set the time out...

Good Luck!!

..-=ViKtOr=-..
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391484
You can send a wm_SysCommand message with the WParam parameter set to SC_MonitorPower and the LParam parameter set to 1 to turn the monitor off, and -1 to turn the monitor back on. The following example turns the monitor off for a 10 second interval.


procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Enabled := false;
  Timer1.Interval := 10000;
  MonitorOff := false;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  if MonitorOff then begin
    MonitorOff := false;
    SendMessage(Application.Handle,
                wm_SysCommand,
                SC_MonitorPower,
                -1);
    Timer1.Enabled := false;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  MonitorOff := true;
  Timer1.Enabled := false;
  Timer1.Enabled := true;
  SendMessage(Application.Handle,
              wm_SysCommand,
              SC_MonitorPower,
              1);
end;


Cheers,

Epsylon.

0
 

Author Comment

by:ryan_sabarre
ID: 1391485
can you give me a code for it? is it...

// for low power
SPI_SETLOWPOWERACTIVE := 0
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ryan_sabarre
ID: 1391486
Im going to give points to Epsylon couze he gave me
a source code for it.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391487
Thanks a lot!!

Cheers,

Epsylon.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391488
Please grade  :o)
0
 
LVL 3

Expert Comment

by:bryan7
ID: 1391489

0
 

Author Comment

by:ryan_sabarre
ID: 1391490
Sorry i like the answer of Epsylon
0
 

Author Comment

by:ryan_sabarre
ID: 1391491
Sorry i like the answer of Epsylon
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391492
The answer is:

You can send a wm_SysCommand message with the WParam parameter set to SC_MonitorPower and the LParam parameter set to 1 to turn the monitor off, and -1 to turn the monitor back on. The following example turns the monitor off for a 10 second interval.


procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Enabled := false;
  Timer1.Interval := 10000;
  MonitorOff := false;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  if MonitorOff then begin
    MonitorOff := false;
    SendMessage(Application.Handle,
                wm_SysCommand,
                SC_MonitorPower,
                -1);
    Timer1.Enabled := false;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  MonitorOff := true;
  Timer1.Enabled := false;
  Timer1.Enabled := true;
  SendMessage(Application.Handle,
              wm_SysCommand,
              SC_MonitorPower,
              1);
end;


Cheers,

Epsylon.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391493
???????
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391494
> Sorry i like the answer of Epsylon

Why do you reject it then ??????
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1391495
> Sorry i like the answer of Epsylon

Why do you reject it then ??????
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391496
ryan_sabarre, are you going to do something?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391497
Hello?
0
 
LVL 7

Expert Comment

by:linda101698
ID: 1391498
ryan_sabarre,
Some guidance on the use of Experts Exchange.

When an expert provides an answer which helps you solve the problem, you should first make sure the correct expert has the proposed answer and then grade the question.

Once an answer as been posted - BY THE EXPERTS YOU WANT TO RECEIVE THE POINTS - then you should grade the question.  The option you receive should look like the following example.

"expert"  has proposed an answer to your question - you'll find it in the green above text box.

 Please take a moment now and evaluate "expert's" answer.

 After evaluating "expert's" proposed answer you may reject or accept the proposed answer, or ask for more details by posting a comment.

 What would you like to do?
    1.Accept "expert's" proposed answer and close the question.
       Select an appropriate grade for "expert's" answer - higher grades do not cost       more points to give so please do be fair.
          A: Excellent!
          B: Good!
          C: Average.
          D: Barely acceptable.

    2.Reject "expert's" proposed answer and reopen the question to other experts.
       Reject this answer. (Please leave a comment explaining why the answer is
       unsatisfactory)

    3.Increase points to:  

    4.Post a comment to provide or request more information

You indictiated that Epsylon's answer was good.
 Comment
     From: ryan_sabarre
                                    Date: Sunday, August 01 1999 - 09:39PM PDT
     i like the answer of Epsylon

What you need to do is choose the grade you want to give since Epsylon has the proposed answer and click on submit to grade this question.

Linda Gardner
Customer Service @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6872419
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

670 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