Click here to Skip to main content
15,887,342 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello,

I need to get detailed information about pc usage like

1) How long its used?

2) idle time

3) used apps and Usage duration

4)Internet usage and websites visited

No clue about where to start.. Somebody please help
Posted

1 solution

Based on this information it's hard to help.
How is "used apps and usage duration" defined?
- How long does the process exist?
- How long is it in foreground?
- GUI processes only?

define "how long is a pc used"?
- how long is the user logged in?
- at least a mousemove every x seconds counts as "used"?
- when does "idle time" start?

To start:
- Write a windows service that does checks in background threads.
- capture mouse position and keyboard state -> if it changed, the pc is in use... if it didnt change for x seconds/minutes, start idle counting
- capture a list of running processes and use winAPI to get the foreground window (this is what you could call "app usage") and measure the time per window.
- find a window named "edge","chrome","firefox","internet explorer" and just capture the title bar, so you get at least the name of the website (and not the real url) - name should be fine.

Just launch some background worker threads in your service, checking all of the above and run some internal dictionaries/lists of the items counting and measuring the time.

I hope this helps you to get started.

regards,
Mike
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900