How to pass a Window Handle to a sub-process?

Viewed 4700

I am working on a special project with an unusual design.

In my application/process, I will create a sub process to do some work. In my process, I need to get the feedback from sub process. I want to pass the Windows handle of my application/process to this sub process, so I am post message from this sub process.

How can I pass Window Handle to sub process? My sub process is an command line application without Window UI and with the main function like this:

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPTSTR lpCmdLine, int nCmdShow)

Should I pass Window Handle to the main function? How?

Thanks

2 Answers
Related