Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Get computer idle time

by bofh_of_oz (Hermit)
on Jun 30, 2005 at 19:38 UTC ( #471443=perlquestion: print w/ replies, xml ) Need Help??
bofh_of_oz has asked for the wisdom of the Perl Monks concerning the following question:

Most venerable Monks,

I wonder if it is possible to get the amount of time since last activity on the computer (in Windows), similar to the way a screensaver is shown only after X amount of inactivity...

The reason for this is that I want to automate my "time on call" spreadsheet submittal. I managed to make it modify the cells needed and to print the document - but as it is confidential, I need to print it only when I'm at the computer so that I can go and pick it up, and this inactivity time seems to be a good way to do it... that is, if I can make it work...

Any advice appreciated.

--------------------------------
An idea is not responsible for the people who believe in it...

Comment on Get computer idle time
Re: Get computer idle time
by jdhedden (Deacon) on Jun 30, 2005 at 19:51 UTC
    I don't see anything in Win32 for this, and according to this article you need to create a DLL to hook into the system to do what you want. The link gives source code on how to do it.

    Remember: There's always one more bug.
Re: Get computer idle time
by waswas-fng (Curate) on Jun 30, 2005 at 22:59 UTC
    I don't get it. If you need to be at the computer for it to print, why not just make it a clickable script? If your not there to click it the darn thing will not spew your paper to the printer. Seems more logical then trying to divine when you are at your computer via activity.


    -Waswas
      Because if it is a clickable script, I will need to remember to click it, which I can forget, which is the main reason for creating the script in the first place.

      Essentially, I, being a very lazy guy with some programming skills, want to make my life so easy that all I would have to do to submit an overtime report is to walk up to the printer, pick up the already printed report, and give it to the manager. Sounds reasonable, right?

      --------------------------------
      An idea is not responsible for the people who believe in it...

        Essentially, I, being a very lazy guy with some programming skills, want to make my life so easy that all I would have to do to submit an overtime report is to walk up to the printer, pick up the already printed report, and give it to the manager. Sounds reasonable, right?
        Are you burning overtime to make this happen?

        Seriously, if you want something to run after some amount of inactivity, you may be in trouble. Let's say it runs after 10 minutes of inactivity. Does it print every time you go to the washroom? Talk on the phone? Fall asleep at your desk?

        -QM
        --
        Quantum Mechanics: The dreams stuff is made of

Re: Get computer idle time
by Ace128 (Hermit) on Aug 03, 2005 at 07:32 UTC
    Well well.. check this out:

    http://www.see.ed.ac.uk/~mrichar1/perl/

    (got there by:
    Google -> http://www.codeproject.com/dll/trackuseridle.asp -> http://www.codeproject.com/dll/trackuseridle.asp?df=100&forumid=2894&select=772522#xx772522xx)
    Ace

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (17)
As of 2014-09-02 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (22 votes), past polls