Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Win32::API and SPI_GETSCREENSAVETIMEOUT

by Anonymous Monk
on Jan 31, 2012 at 14:37 UTC ( [id://950992]=note: print w/replies, xml ) Need Help??


in reply to Win32::API and SPI_GETSCREENSAVETIMEOUT

SPI_GETSCREENSAVETIMEOUT is not a function, it is a constant, a flag, an option, a number :)

The function name is SystemParametersInfo

I would use the registry, screensaver registry timeout -> How to change the Windows Logon screen saver in Windows XP

$ reg query "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v ScreenSaveT +imeOut ! REG.EXE VERSION 3.0 HKEY_USERS\.DEFAULT\Control Panel\Desktop ScreenSaveTimeOut REG_SZ 600

Replies are listed 'Best First'.
Re^2: Win32::API and SPI_GETSCREENSAVETIMEOUT
by aplonis (Pilgrim) on Jan 31, 2012 at 16:20 UTC

    Thank you. That is moderately helpful information, especially the forepart. I'm not a Win32 guru or even very much adept in Perl anymore. So I'm back to making newbie errors. Embarrassing, but there it is.

    Still I like to update my old scripts if folks (expecially myself) still find them useful. And this one apparently other people even besides myself still do. The whole reason for this particular script is to defeat the IT admin mandated screensaver policy of every few minutes requiring activity or a screen lock. They cannot be made to understand that while it is right and proper for the CAD designers to not leave their IP up while going on break it is a whole different story for us test engineers who have to go into the test cells to turn a valve, measure a voltage and so forth while expecting to come back after two minutes to the PC controlling our test to that we might adjust a pressure or flow...or to hit pause (not E-stop) in a semi- (but not all out) emergency. Having to constantly be re-logging in can upset the timing of a test and adversely affect the result.

    In short, I have to do it with Perl, not via the regular Windows way (because that is disabled by default). Local IT admins in my last two jobs have sagely understood and not very loudly objected to sparing use of a screensaver defeat script (mine, in fact, at both places) for some years now. But neither have either of them been willing to fight the good fight to push this issue with their own higher-ups out-of-state or overseas.

    Now the same script which has worked for years is only semi-reliable on Win7 while it was fine on Vista, XP and 2000. I added in Tye's mouse-jiggle function to no additional increase of reliability. So I'm still wanting to make it wholly reliable again. I want to do that for myself and everyone who seems to like it. I need to do it in Perl. Anyone with a helpful example to offer will be very appreciated. Thank you.

      Take a look at caffeine.exe. This is a utility which effectively prevent a system from lock also on Win7.

      Wait what?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found