Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6837135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:26:24+00:00 2026-05-26T23:26:24+00:00

Does anyone know of a way to detect recent activity in a VB.net windows

  • 0

Does anyone know of a way to detect recent activity in a VB.net windows forms application?

We have a retail store where users share floor computers, the application will be on each machine and require a log in before use. I am trying to find a way to automatically close the application if it has been idle for lets say 10 minutes.

I guess I could do something similar with the current windows log on session – set a gp that logs the user out after 10 minutes of inactivity – but if there is an easy, non memory intensive way to do it in vb.net i would rather use that method

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:26:25+00:00Added an answer on May 26, 2026 at 11:26 pm

    When the applications starts, create a handler for the Application.Idle event. Also create an object that is your 10-minute timer. The Appliation.Idle event is raised every time the event queue is empty. If you move the mouse, that raises an event. If you press a key, that raises an event. Note that you cannot use the Handles keyword with Application.Idle. Handles only works for locally decalred objects, not static objects.

    Public Sub MainForm_Load(sender As Object, e As EventArgs) Handles MainForm.Load
        AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle
        ' TODO: Create the 10-minute timer.
    End Sub
    
    Private Sub Application_Idle(sender As Object, e As EventArgs)  
        ' TODO: Restart the 10-minute timer.
    End Sub
    
    ' This assumes your TenMinuteTimer object has an Expire event.  Do what works for you instead.
    Private Sub TenMinuteTimer_Expire(sender As Object, e As EventArgs) Handles TenMinuteTimer.Expire
        ' TODO: Close the application safely.
    End Sub
    

    The only issue with this is if the user starts an action that takes longer than 10 minutes, it will raise Application.Idle after TenMinuteTimer.Expire. If you expect this may happen, be sure to disable the TenMinuteTimer before executing long-running code and enable it again afterwards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know a way to open a 2nd form in a .NET application
Does anyone know of a way to detect when the last time a Microsoft
Does anyone know a way to detect the older set of devices: iPod touch
Does anyone know what would be the best way to detect which version of
Does anyone know a way to detect if a button with this, code below,
does anyone know a good way to, in code, detect if the app is
Does anyone know of a way to detect if a remote app has failed/crashed?
Does anyone of you know a cross browser working way to detect paste or
Does anyone know a way to auto-generate database tables for a given class? I'm
Does anyone know a way to find out programatically which physical disk holds a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.