` Printed Icetips Article

Icetips Article



Par2: Checking for screensaver - API call
1998-04-26 -- Stephen Bottomley
 
This asumes 32bit

SystemParametersInfo(UNSIGNED,UNSIGNED,PVOID,UNSIGNED),BOOL,PASCAL,
    RAW,NAME('SystemParametersInfoA')

SPI_GETSCREENSAVEACTIVE    EQUATE(16)
SPI_SETSCREENSAVEACTIVE    EQUATE(17)
SPIF_SENDWININICHANGE       EQUATE(0002h)

IsActive   BOOL

To detect if the screen saver is enabled, use this:

   SystemParametersInfo( SPI_GETSCREENSAVEACTIVE,0,ADDRESS(IsActive),0)

On return, the variable IsActive will be TRUE if the screen saver setting is enabled in
the System control panel applet and FALSE if the screen saver setting is not enabled.

To disable the screen saver setting, call SystemParametersInfo() with this:

SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,FALSE,0,SPIF_SENDWININICHANGE)



Printed November 23, 2024, 2:14 am
This article has been viewed/printed 35321 times.