Monitoring equipment (TFT-display, monitor) with .NET / C #

I know that I can be away from the line :-)

I want to manage my Drive from a .NET application. The background is simple: there is a really nice tablet that should become my little helper. For this reason, it will always be on. But the display can be turned off if not needed, and turned on when something happens.

So how would you solve this:

MyPc.Utils.SwitchOnDisplay();

Man, I would like everything to be so simple ... I'm sure I need to delve into some DLLs, but maybe at least someone knows the search word better than DIM DISPLAY C #

Chris

PS: Suppose that WinXP, and all screensavers or simulation management tools, are never installed. Oh, and in a few weeks I will have the same question with Windows 7 :-)

+3
source share
2 answers

See Turn off the monitor using code (C #) . This is pretty thorough, but including it from a WinForms application comes down to the following:

SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, โ€“1);
+1
source

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

0
source

Source: https://habr.com/ru/post/1711293/


All Articles