Search code examples
c#c++interopcom-interop

How to get text from unmanaged application to a c# application?


I have a 3rd party application, which creates several windows of which each has a textbox with text I want. I then want to use that information within my application, so I just need to obtain that information (possible trigger some commands back to it later on by pressing buttons)

The 3rd party application is un-managed C++. My application is C# (.NET 4.0).

I have seen that you can do 'hooks' into other application but I'll be honest I am completely lost of which route to take and how to go about it.

Some advice would be great.


Solution

  • The easiest interop with an unmanaged C++ is via C++/CLI. If there's already a simple C wrapper then P/Invoke will be sufficient.