Frienldy is a magical library!
It breaks through the walls of process!
Here is some sample code to show how you can get started with Friendly
This is a perfect ordinary Windows Application that is manipulation target.
(There is no kind of trick.)
This is a test application (using VSTest):
Match the Processor Architecture. (x86 or x64)
The target and test processes must use the same processor architectue.
If you are using VSTest, you can set this by using the Visual Studio menus as shown below.
If the target process is running as an administrator, the test process must run as an administrator, too.
You can accomplish this by running Visual Studio as an administrator, as shown below:
Connection to Execution Thread
Operations can be executed on the main window thread:
Operation can also be executed on a specified window thread:
Invoking Static Operations（Any OK）
Invokeing Instance Operations
Variables are referenced from the target process.
You can access public and private members.
Instantiating New Objects
Copy() and Null()
Rules for Arguments
You can use serializable objects and reference them in the target process.
If you use serializable objects, they will be serialized and a copy will be sent to the target process.
Note the Casting Behavior
AppVar is part of the old style interface.
You will need to use AppVar if you use the old interface or if you can't use the .NET framework 4.0.The old style sample code is pending translation, but the code is in C#.
Please have a look here if you are interested.
Friendly operations are executed synchronously.
But you can use the Async class to execute them asynchronously.
Properties and Fields
Native dll methods.
They are built on top of Friendly.
They wrap GUI manipulation by Friendly.