Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Keep the playback rolling (Win32)

by BrowserUk (Pope)
on Feb 20, 2009 at 11:58 UTC ( #745341=note: print w/replies, xml ) Need Help??


in reply to Keep the playback rolling (Win32)

You can disable the screensaver for the duration of a program using this. Supply the normal command line for the app as the arguments to this. To test it, set your screensaver timeout to 1 minute and run a command like:

noss perl -le"sleep(1), print for 1 .. 61"

noss.pl:

#! perl -slw use strict; use Win32::API::Prototype; ApiLink( 'user32', q[ BOOL SystemParametersInfo( UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni ) ] ) or die $^E; SystemParametersInfo( 0x0011, 0, 0, 0 ) or die $^E; ## SS off system @ARGV; SystemParametersInfo( 0x0011, 1, 0, 0 ) or die $^E; ## SS on

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Keep the playback rolling (Win32)
by tye (Sage) on Feb 20, 2009 at 16:02 UTC

    I would guess that this is along the lines of what Windows Media Player does to disable the screen-saver and so it seems likely to not work for peons trying to disable administratively mandated screen-saver timeouts. But that is just a guess.

    - tye        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2019-12-16 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?