tags:

views:

475

answers:

2

Hi,

I know, I am propably way out of line here :-)

I want to control my Display from within a .NET application. Background is simple: There is a really nice Tablet which should become my little helper. For this reason, it will be always on. But the display can be switched off if not needed, and switched on when something interesting happens..

So how would you solve this:

MyPc.Utils.SwitchOnDisplay();

Man, I wish it would be that easy... I am sure I have to dig into some DLLs, but hey, perhaps at least somebody know a search word better than DIM DISPLAY C#

Chris

PS: Assume a WinXP, and all screensavers or powermanagement dimming stuff set to never. Oh, and in a few weeks, I will have the same question with Windows 7 :-)

A: 

See Turn off your monitor via code (C#). That's pretty thorough, but turning it on from a WinForms app boils down to:

SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, –1);
Matthew Flaschen
This won't let you turn on or off a specific monitor - it does all of them. I believe he wants to be able to turn off his tablet, but leave on his main monitor, from the sounds of things. I may be misunderstanding the question here, though...
Reed Copsey
Thanks, nice to know.. But no, the answer is "correct". I want to turn of my tablet (T1028), but it is an "independent" machine. So the solution should work for me, have to test it the next days...
Christian
A: 

You could use CIM_DesktopMonitor.SetPowerState to handle this. It is supported on Windows 2000 and above, including XP and Win7.

Reed Copsey