Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off particular monitor with .NET?

Tags:

c#

screen

monitor

OK, I know there are quite a few posts on this topic. However, none of them provide the solution to my issue: I don't want just to turn off my monitor(s), I wish my code to turn off a specific monitor. The URL the most people refer to, http://fci-h.blogspot.com/2007/03/turn-off-your-monitor-via-code-c.html, doesn't help here, as it turns off all the displays.

So, I have my laptop screen and an additional external monitor. While I'm watching movies, I switch the display to the external monitor and my laptop screen goes black, however, it's still on and glowing in the dark. I wish to turn it off. Could anyone help please?

EDIT: Is there any way to acomplish this, meaning it needn't have to be written in .Net. Basically, I just need an .exe file that's able to turn the particular monitor off and on alternately.

like image 956
Boris Avatar asked Apr 05 '10 00:04

Boris


People also ask

How do I turn my computer monitor off?

After finding the power button, press the button to turn off the monitor. Sometimes, you may need to press and hold the power button for 2 or 3 seconds to power off the monitor. Some monitor power buttons may also only require your finger touch and not push in on the button.

How do I turn my laptop screen off only?

Close the Lid You can adjust your machine's power settings so that when you close the lid, only your screen is turned off and nothing else. Head to Settings > System > Power and Sleep > Additional Power Settings.

How do I turn off display without sleep?

You can change the power settings to shut off the display when the power or the sleep button is pressed. Right-click on the battery icon on taskbar, click "Power Options", click "Change what the power buttons do", then change the settings as necessary.


1 Answers

It looks like there's no good way of turning off a specific monitor, but it is possible to set your laptop's backlight to minimum brightness. Depending on which version of Windows you have, there are different ways to do it:

  • send IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS I/O control as described here: http://msdn.microsoft.com/en-us/magazine/dvdarchive/cc163415.aspx
  • use WMI method WmiSetBrightness as described here: What API call would I use to change brightness of laptop (.NET)?
  • use Win API SetMonitorBrightness, but I don't know of anybody who has done it in C#.
like image 97
Gabe Avatar answered Oct 01 '22 02:10

Gabe