George,
You are correct the code does work as expected from the VFP command window.
Although I used the following code in a timer control timer event and compiled to a exe file. If the screen saver is active the message box is not visible until you access the computer.
Timer.Interval = 180000 ( 3 minutes )
Screen Saver Wait = 1 minute
Let me know if you get similar results.
Ray
#DEFINE GETSCREENSAVEACTIVE 16
#DEFINE SETSCREENSAVER 17
DECLARE SHORT SystemParametersInfo IN WIN32API ;
INTEGER uiAction, SHORT uiParam, ;
INTEGER @pvParam, INTEGER fWinIni
lnvparm = 0
= (SystemParametersInfo(GETSCREENSAVEACTIVE,0, @lnvparm,0) # 0)
DECLARE SHORT SystemParametersInfo IN WIN32API ;
INTEGER uiAction, SHORT uiParam, ;
INTEGER pvParam, INTEGER fWinIni
IF lnvparm = 1
liniparm = 0 && Disable Screen Saver
=(SystemParametersInfo(SETSCREENSAVER,liniparm,0,0) # 0)
MESSAGEBOX("Screen Saver has been disabled."+CHR(13)+"Press OK to restart...")
liniparm = 1 && Enable Screen saver
=(SystemParametersInfo(SETSCREENSAVER,liniparm,0,0) # 0)
ELSE
MESSAGEBOX("Screen Saver is not enabled")
ENDIF
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only