Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Detecting idle time from a .Net application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan Nieuwland - 24 Sep 2004 17:29 GMT
I'm having a lot of trouble finding a universal and stable solution to the
problem of detecting a session's idle time. I have a .Net application that
runs in the system tray, much like many of the messenger services out there.
From what I've read in the newsgroups, there are several mechanisms that I
can try, but the biggest problem is that I have to get it working on Win98,
WinME, Win2K and WinXP.

The options I've found are:

1) On a timer, use GetLastInputInfo to check the last input event

No good. This requires Win2K and up - I need to run on 98 and ME

2) Add a low-level mouse and keyboard hook in my .Net application using
SetWindowsHookEx specifying the hooks WH_MOUSE_LL and WH_KEYBOARD_LL

Again, works great in XP, but WH_MOUSE_LL and WH_KEYBOARD_LL are
incompatible with 98 andME

3) Add a global mouse and keyboard hook in an external DLL using
SetWindowHookEx and WH_MOUSE and WH_KEYBOARD

This work fine accross all platforms, but for some reason whenever the
screensaver kicks in, my hook stops receiving events.

So my question is, is there another solution I should try, or is there
something I should be aware of that could get any of the above solutions to
work?
Chris Dunaway - 28 Sep 2004 15:11 GMT
> So my question is, is there another solution I should try, or is there
> something I should be aware of that could get any of the above solutions to
> work?

Would the Application.Idle event help you?

Signature

Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.