views:

35

answers:

1

Hi all, Im writing an application that needs to get notified when a control in another application is clicked\invoked. How can i catch the click from my application?

Here are some more related questions :

  • Is UIAutomation can be a solution? is it working on unmanaged applications also?
  • Is the Spy++ solution works also on managed applications?

i'll be happy with any help.

A: 

You need to use Global Hooks, but in managed apps you can only set up Global Hooks for keyboard and mouse events. So you will need to write an unmanaged app to do this.

Here's a blog post where a MS guy discusses the internals of Spy++ which might be useful:
http://blogs.msdn.com/vcblog/archive/2007/01/16/spy-internals.aspx

ho1