Ramon Smits

Tell me your secrets and i'll tell you mine

Recent Posts

Tags

Community

Email Notifications

Patterns & Practices / Guidelines

EntLib

Nant

Blogs that I monitor

Archives

IdleTimer to have MSN like behaviour in your application

I've just created a little nice class that helps in building applications that need MSN like behaviour regarding detecting a users idle time. This can be very handy when your application notifies the user for some special event through a non intrusive popup for example. But will the user see this popup when it isn't behind it's computer?

This is where this class comes in. When you detect that the user is idle you stack the notification events until the user is active again to show them to your user.

I have seen bad implementations that use hooks to intercept window messages. But those are real nasty and have impact on system performance. This class uses the GetLastInputInfo api call to ask the system once in a while if there has been user activity. Just take a look at the code by downloading the class IdleTimer.cs.

I have seen some implementations that detect a user idle'ness this way but not a single one also includes an event that get's fired when a user is available again. So that is my UDP (unique download point...).

Comments

Ramon Smits said:

I posted an article that includes a link to a class file I wrote today that can detect if a user is idle...
# December 24, 2005 1:10 PM

Ramon Smits said:

I posted an article that includes a link to a class file I wrote today that can detect if a user is idle...
# December 24, 2005 1:11 PM

Ramon Smits said:

I posted an article that includes a link to a class file I wrote today that can detect if a user is idle...
# December 25, 2005 2:08 AM

Ramon Smits said:

I posted an article that includes a link to a class file I wrote today that can detect if a user is idle...
# December 25, 2005 3:30 AM

Colin said:

You should zip the IdleTimer.cs or rename it to .txt because an asp.net enabled IIS server will not serve .cs files.
# December 26, 2005 11:44 PM

Ramon Smits said:

I posted an article that includes a link to a class file I wrote today that can detect if a user is idle...
# December 30, 2005 8:56 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 3 and 6 and type the answer here: