Solved

Monitor PC activity

Posted on 2004-09-16
7
544 Views
Last Modified: 2010-04-15
I am developing an application that monitor activities on XP/win2k machine. It is a simple application that calculates total idle time and active time and produces a report daily. The machine is considered idle if there's no keyboard or mouse movement.

What's the best way to do the above ? I am trying a method that detects keyboard and mouse activities,  basically capturing windows event such as WM_KEYUP, WM_LBUTTONDBLCLK, etc.. My question is how reliable this method is ? I am using SetWindowsHookEx API call to intercept the windows messages.

Thanks.
0
Comment
Question by:MyQ2004
7 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 12082051
Capturing such activities from all applications is always made with hooks. So you went the right way. Now the only thing you need to refine is what events you want to capture. Maybe you will need WM_KEYDOWN, WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MOUSEWHEEL because with the events you showed, you will only capture double clicks from the left button, nothing from the right button, nothing from the mouse wheel.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12082091
this example may help you for a start
http://www.codeproject.com/csharp/globalhook.asp
0
 
LVL 7

Expert Comment

by:jimwasson
ID: 12084235
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:MyQ2004
ID: 12246651
How do I use performance data to check if the user actually used the keyboard or mouse ?
0
 
LVL 18

Accepted Solution

by:
armoghan earned 125 total points
ID: 12247508
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12247556
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12295394
Glad to help
Thanx for accepting
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question