Should have been simple I would have thought. I want to force the PC to go into screen saver mode, and exit it when conditions I am checking in by D2006) app come true. It doesn't seem to work:
if ScreenSaverExitRequested then
begin
SystemParametersInfoResult := SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, @ScreenSaverIsRunning, 0);
if ScreenSaverIsRunning then
begin
SystemParametersInfoResult := SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, UINT(false), nil, SPIF_SENDWININICHANGE);
end ;
end ;
....
if ScreenSaverEntryRequested then
begin
SystemParametersInfoResult := SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, 1, nil, SPIF_SENDWININICHANGE) ;
end ;
SystemParametersInfoResult is returning true in each case. The calls to SystemParametersInfo don't seem to have any effect. If I place the PC in SS mode by using the "Preview" button on the Control Panel Display Properties dialog, executing my code does nothing.