How to use SendMessage in C# to turn off the monitor on Windows 11 Modern Standby

604 Views Asked by At

I have in the past, used SendMessage(handle, 0x112, 0xF170, 2); to turn off the monitor leaving the machine on. It works great until Modern Standby came along and screwed everything up. The above now makes the entire computer go into sleep mode (S0 Low power idle) instead of simply turning off the screen and letting the computer on.

I have set in settings, for the screen to turn off after 1 minute, and sleep to start after 15 minutes. And the system is capable of doing this without the machine entering sleep mode after the first minute. I know windows can do this, I just am unsure of how or if something in the parameters needs to be changed.

My issue is similar to this one: SendMessage turn Off the monitor makes some system sleep in vb

1

There are 1 best solutions below

0
Donald On

Thanks for the tip, on a normal desktop PC SetVCPFeature works fine, however it does not work with a tablet (Surface 3 non pro). SetVCPFeature always returns false, and the screen is not turned off.

Here https://milek7.pl/ddcbacklight/mccs.pdf you can find a description of the SetVCPFeature parameters, I tried 2,3 and 5 instead of 4 without success. The internal display could not be switched off with these parameters

Also ControlMyMonitor.exe from nirsoft (https://www.nirsoft.net/utils/control_my_monitor.html) does not work, returns an I2C Error...