Interprocess Communication Between .NET and MFC Using WM_COPYDATA – CodeProject
The .NET Application
Obtaining a Handle to the Target ProcessThe Init function starts the MFC application as a child process, and saves the main window handle which is needed to transmit the data. For my purposes, this method is much simpler than the traditional way of “finding the process” by using the Win32 functions FindWindow and EnumWindows. In addition, it guarantees the handle of the correct instance of the target application.