views:

101

answers:

1

I'm asking mostly out of idle curiosity.

When using TestComplete, I've noticed I can point my script at an arbitrary running .NET application, grab a control, reflect on it, and even call methods on it. I have no idea how they pull this off. This isn't simple UIAutomation, as far as I can tell, since I can grab private fields. Also, this isn't remoting, because the app has no extra hooks.

How can I get a hold of another .NET object running on another process and call into it?

+1  A: 

This is a form of code injection.

It is just much easier with .Net once you have been injected to do invasive things like grabbing private variables and the like because the introspection aspects are already built in for you to use.

This code project article shows you how to do it

ShuggyCoUk