Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling a screen saver
Message
 
To
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:
00094490
Views:
28
>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

Ray,

I think that the timer is somehow messing things up. I wrote a short program to toggle the state, compiled it into an existing executable, and ran it directly (not from the VFP command window) from a shortcut on the desktop. It worked just fine. Basically the only difference in what you did and what I did is is the timer, so that's why I say what I said.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform