Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
i have this idea , i want to make a program that shows statistics of programs running on the pc and the up time of the programs , for instance u run it on startup and by the end of the day you can see what program you used more during the day and how much time u spent on it, i havent started on the coding yet as im a bit confused on where to start , any tips? or direction i can use and what methods would i use to capture the data? its going to be a timer and the getTime(); for the elapsed times ect ect but what will be used for tracking exes?

What I have tried:

google on solutions and some call methods on what to use
Posted
Updated 10-Apr-16 23:25pm
Comments
OriginalGriff 11-Apr-16 3:51am    
I think you first need to think a bit more about exactly what you are trying to track.
At the moment I have 2 file explorer windows, email, Chrome, two different in-house apps, two Visual Studio instances (2013 and 2015), an internet site monitoring app, SSMS, Expresso, LibreOffice Writer, and a text editor open. But...I'm only using Chrome directly, and that's not using a whole load of CPU time since I'm typing in a text box.
So which of these am I "using"? Three of them are "background" apps unless something happens that I need to know about (an email arrives, for example) but I'll still cast an eye over their windows several times an hour without giving them the focus. Does that count as "use"?
Work out what exactly you are trying to do first, and then perhaps we can help you to do it. But a generic "what program you used more during the day and how much time u spent on it" doesn't really mean anything in the "real world"!
jamesmc1535 11-Apr-16 4:05am    
very good example, sorry for not being able to be more precise,as im not fully certain on what precisly needs to be done, basicly for now id like to create an app that shows all the current processes/exe"s thats running, but the main idea is like for instance when playing a game , it must show the exe of the game and the runtime of the game running , example: so if you open chrome.exe it shows in the application chrome.exe : 1 hour

1 solution

You actually answered your own question in your response to Originalgriff.

Make an application that simply runs parsing the running applications in windows which is technically called "Enumerating All Processes".
That information is given up by Windows via the Process Status Application Programming Interface (PSAPI).

Enumerating All Processes (Windows)[^]

So there you have your start point and the coding to start is rather trivial and you can even work out what app is foreground and what apps are background.
 
Share this answer
 
v5
Comments
jamesmc1535 11-Apr-16 6:25am    
thanks :) really appreciate it, will have a look at that quickly :)
jamesmc1535 11-Apr-16 6:45am    
thanks it was exactly what i was looking for :)

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