There are two applications: one console, the other graphic. The console application on launch from the command line accepts the parameter specified in the command line and transfers this parameter to the graphical application. The idea is as follows: when launching the console application, find the target window of the graphical application and send it a message with a parameter. Both applications on MFC + WinAPI.

How to find the target window?

    1 answer 1

    As an option. When creating a graphic application window, choose a unique class or a unique window name. In the console application, search for a window by class or by name. The required functions are: RegisterClass , CreateWindow and FindWindow .