Solved

c# code to put monitor to sleep and awake

Posted on 2014-09-23
4
300 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 74

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 41

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

21 Experts available now in Live!

Get 1:1 Help Now