I think P / Invoke is the easiest approach:
- Create a DLL in unmanaged C ++ that contains all the functions needed to complete the injection.
- In C # code, declare some methods
static externand use the attribute DllImportto point them to your C ++ dll. For more information, see the Link provided by arul in his answer .
Please note that P / Invoke is not limited to “Windows API functions” - you can call functions open by any native DLL.
P/Invoke , ++, , . COM- "" DLL COM interop #.