views:

35

answers:

1

Hello,

I need to retrieve values from an external application but it does not provide any API to do so. The values are ever-changing and not fixed.

Is there a way to retrieve the values from the application?

Maybe getting into the message loop for that particular application and filtering for certain window messages which contains the value. Or perhaps, using Microsoft Automation Toolkit to search for the relevant controls and getting the values of it.

Thanks for taking your time to read this.

P.S. I was looking into something like SetWindowsHookEx or anything similar.

Does it help to use RegisterWindowMessage if I were to know the string which the application used to register?

+1  A: 

You'll need to setup a global Windows Hook and you need to write a C++ DLL for receiving the callback. I'd suggest looking at this MSDN Magazine article. It describes a tool called ManagedSpy but even if you want to "spy" on an unmanaged app the hook code should be the same.

ho1