CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2000
    Posts
    2

    System Idle Time

    Hi,
    Can I know the sytem idle time i.e., a particular system is idle for how much time.
    I want to perform some operation if the system is not used for about let us say 10 min. (Like how screen saver executes when you leave the system for the specified time)
    Please help me.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: System Idle Time

    Add timer to your form and at the end of each procedure start the timer which will calculate the idle time. At the beginning of each procedure reset the timer

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Mar 2000
    Posts
    2

    Re: System Idle Time

    Thank you for the reply.

    I'm sorry, my question may not be clear.

    I have 140 forms in my project. Enabling timer control at each and every proceedure in 140 forms is not a simple task.
    Are there any API calls to find out the system idle time or Application Idle time, i.e user is not using my application for about let us say 15 min.

    Thank you once again

    Sricharan


  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: System Idle Time

    Another way of doing this is just to create another Form with the timer on it. You can load the form with the Visible property set to FALSE. Then create a public fuction in that FORM to ENABLE/DISABLE/RESET the timer.

    Load the form on startup and each other procedures can just call the public functions to ENABLE/DISABLE/RESET the timer as needed. If the timer has been enabled and no one calls the RESET/DISABLE, then the form can do the neccessary action when time is up.

    -Cool Bizs

    Good Luck,
    -Cool Bizs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured