Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling a screen saver
Message
From
23/04/1998 15:35:01
Ray Watson
A Certified Electronics Co
Knoxville, Tennessee, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00093980
Message ID:
00094434
Views:
35
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
Map
View

Click here to load this message in the networking platform