How to calculate the total execution time of each application Win (process) with the group on day.
For example:
the process – notepad.exe – 10 minutes today (in total)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would use a WMI query against Win32_Process and retrieve the CreationDate value which according to MSDN is the date (and time) a process began executing.
A good library for Delphi is available from Magenta Systems. This library includes several examples to help you get started.
This only tracks currently running processes. If your wanting to track processes which were run once but are no longer running, then you will want to hook into windows so you are notified at each application launch. One example of this would be to use the CBT hooks (computer based training, but its used for other things also) which allow you to get notified every time a window is created. If you use the window handle to then find the parent process, you can then use this to track for yourself how long the parent process is running.