I want to develop a windows application that will monitor whether a program has started (lets say windows calculator) and time for how much time it has been used. I know I could poll the process to see whether it is on but I am not sure that this is the best solution.
I was considering global system hooks but after looking for hours I ended up more confused than from when I started. Are there any pointers towards any tutorials on how to do what I want or just some ideas. Is this something that needs global hooks or something else is better?
I don’t mind using either C# or C++ so please feel free point out to any relevant tutorials or documentation for either.
Thanks
Check process info (using polling)
Register an event using native Windows (WMI) APIs: