Turn on monitor when running as system service using WinAPI/C++?

111 views Asked by At

My application (running as system service) has a feature where the display "blinks" a few times for some reason. This is done through a special API that allows access to the backlight control. This works so far. But when the display turns off because of the "Turn off display" setting in the power options, it seems that nothing hapeens (from user view).

Looking for a solution always ended up in suggestions to use SendMessage, SendNotifyMessage or SetThreadExectionState. These function doesn't work from called from a system service (at least in Windows Vista and later).

I'm quite sure there are ways to turn display on even if there no chance to do that in the user's context because no user is logged on. However, I could not find out, how to. I hope you can help me.

P.S.: I tried with an (helper) application in user mode and could see that it works even if the worksatation is locaked (Win+L). The only problem that remains is that I cannot turn on the display when running as service and no user is logged on.

0

There are 0 answers