Question

I need to write an assembly (C#.net 2.0 class library) to monitor all applications currently running in a PC. Especially, I need to know which window is the top one, i.e., catch the event when a window becomes foreground window. Should I use WndProc() to catch related window messages? (I don't want to use timer).

Any reference paper or sample source code? Thanks a lot.

Was it helpful?

Solution

If you want notifications, you need a CBT Hook.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top