Finding the currently actrive window from a background application

Finding the currently actrive window from a background application

Post by Qmlsb » Sun, 10 Jun 2007 05:48:01


In C#...

I need to create and application that will run in the background and listen
for user mouse clicks anywhere on the desktop or any open application. When a
mouse click happens, it will catch that event and get a reference to the
active application...

Is this possible?

Can anyone give me an idea on how I would acheive this?

Thanks
--
Bill
 
 
 

Finding the currently actrive window from a background application

Post by Moty Micha » Mon, 11 Jun 2007 15:27:20


Dear Bill,

You can use windows hooks for this purpose. It's a bit advanced
programming but it achieves your needs.
Check this detailed article with mouse hook example:
http://www.yqcomputer.com/

Feel free to ask any further questions.
Hope this helps.
Cheers,
Moty