Solved

c# code to put monitor to sleep and awake

Posted on 2014-09-23
4
408 Views
Last Modified: 2014-09-29
Hi

I need a c# code solution to put a Windows 7 Pro monitor to sleep and wake up on command.

Thank you
0
Comment
Question by:SkyMagic
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40341739
What have you tried? What have you looked at?
0
 

Author Comment

by:SkyMagic
ID: 40342588
No was to busy with other work. Was hoping maybe someone had some info.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 40343467
Simple answer is:
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);

Detail instructions are here:
http://www.codeproject.com/Articles/12794/Complete-Guide-on-How-To-Turn-A-Monitor-On-Off-Sta
0
 

Author Closing Comment

by:SkyMagic
ID: 40351315
Thank you!
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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

685 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