1

I am trying to turn a desktop monitor connected to a Windows 10 PC on and off, Any ideas how this could be done by using Delphi?

The following used to work for older Windows versions but it no longer works for Windows 10 "SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, - 1);"

Thanks!

I did not try anything yet because i need some information of how it can be done.

Delphi2022
  • 11
  • 1
  • Not really tied to the Windows version but rather to hardware type? See https://learn.microsoft.com/en-us/windows/win32/menurc/wm-syscommand – Tom Brunberg Dec 17 '22 at 13:32
  • @Delphi2022, have you tried `SendMessage( HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2 {-1} );` – Old Skull Dec 18 '22 at 11:45

0 Answers0