I am TRYING to write a very simple program that toggles the
screen saver enabled/disabled state. I am using it on a
Windows 98 SE platform. The code follows:
#COMPILE EXE
#INCLUDE "win32api.inc"
#RESOURCE "test!.pbr" 'simply adds an icon
'
FUNCTION PBMAIN() AS LONG
CALL SystemParametersInfo(SPI_GETSCREENACTIVE,%NULL,A&,0)
SELECT CASE A&
CASE %TRUE
B$ = "Screen saver *IS* active." + CHR$(13) + CHR$(13)
C$ = "Would you like to toggle it to 'INACTIVE'?"
D$ = B$ + C$
Ans& = MSGBOX(D$,%MB_ICONQUESTION OR %MB_YESNO,"Continue?")
IF Ans& = %IDYES THEN CALL SystemParametersInfo(%SPI_SETSCREENSAVEACTIVE,_
%FALSE,%NULL,0)
CASE %FALSE
B$ = "Screen saver is *NOT* active." + CHR$(13) + CHR$(13)
C$ = "Would you like to set it to 'ACTIVE'?"
D$ = B$ + C$
Ans& = MSGBOX(D$,%MB_ICONQUESTION OR %MB_YESNO,"Continue?")
IF Ans& = %IDYES THEN CALL SystemParametersInfo(%SPI_SETSCREENSAVEACTIVE,_
%TRUE,%NULL,0)
END SELECT
END FUNCTION
The problem with this program is that it ALWAYS says that the
screensaver is NOT active, even though I quadruple checked to
ensure that it were!
Anybody got any ideas?
screen saver enabled/disabled state. I am using it on a
Windows 98 SE platform. The code follows:
#COMPILE EXE
#INCLUDE "win32api.inc"
#RESOURCE "test!.pbr" 'simply adds an icon
'
FUNCTION PBMAIN() AS LONG
CALL SystemParametersInfo(SPI_GETSCREENACTIVE,%NULL,A&,0)
SELECT CASE A&
CASE %TRUE
B$ = "Screen saver *IS* active." + CHR$(13) + CHR$(13)
C$ = "Would you like to toggle it to 'INACTIVE'?"
D$ = B$ + C$
Ans& = MSGBOX(D$,%MB_ICONQUESTION OR %MB_YESNO,"Continue?")
IF Ans& = %IDYES THEN CALL SystemParametersInfo(%SPI_SETSCREENSAVEACTIVE,_
%FALSE,%NULL,0)
CASE %FALSE
B$ = "Screen saver is *NOT* active." + CHR$(13) + CHR$(13)
C$ = "Would you like to set it to 'ACTIVE'?"
D$ = B$ + C$
Ans& = MSGBOX(D$,%MB_ICONQUESTION OR %MB_YESNO,"Continue?")
IF Ans& = %IDYES THEN CALL SystemParametersInfo(%SPI_SETSCREENSAVEACTIVE,_
%TRUE,%NULL,0)
END SELECT
END FUNCTION
The problem with this program is that it ALWAYS says that the
screensaver is NOT active, even though I quadruple checked to
ensure that it were!
Anybody got any ideas?
Comment