Such a problem, I need to programmatically extinguish the backlight of the monitor and then turn it back on, wrote this code:

SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1); 

But for some reason it does not work. They say that it only rolls on XP. And how on the seven to create it?

  • They say that the 98th worked 0 / -1. Someone on XP 0 / -1 does not work, but 1 / -1 works. On the seven earned only 2 / -1. What will happen next? ... - user20165
  • read the documentation . -1 (the display is powering on) 1 (the display is going to low power) 2 (the display is being shut off) - KoVadim

1 answer 1

not quite right ... need:

 SendMessage(Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2);//отключение SendMessage(Handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1);//включение