Delphi code to enable screen saver does not work in Windows 7

I have a Delphi application that puts a computer into a screensaver using

hWnd := GetDesktopWindow ;
SendMessage (hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0) ;

This works fine under XP, but I believe that it does not work under (built-in) Windows 7.

Any ideas?

+3
source share
2 answers

This works for me (Windows 7 Home Premium, 64-bit). Did you try to send a message to another window, for example Handle? (Also, are you sure you have a screensaver installed?)

+4
source

SC_SCREENSAVE , [boot] System.ini. o/s - , , , , system.ini . system.ini.

0

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


All Articles