I need to get all the other applications usage time. I can get which window is active now using GetForegroundWindow. But how can I get notified when the window goes inactive. We cant check repeatedly whether the window is active or not. I dont need the ( process start time - current time) which gives how long the process is running. I want how long the window is active.
Asked
Active
Viewed 271 times
1
-
Do you use wpf or windows forms? Do you build an application to control the usage time of other applications? Is that right. – Jehof Sep 11 '15 at 09:14
-
I am using wpf. yes, my application needs the usage time of other windows. – Unknown Sep 11 '15 at 09:30
1 Answers
0
Look into SetWindowsHookEx
, and specifically, WH_CBT

Mark Jansen
- 1,491
- 12
- 24
-
Do you have any sample code? I could not able to understand the function properly. – Unknown Sep 11 '15 at 10:49
-