Hi Alex,
Here's what happens:
- VFP application issues RUN command
- OS creates a window with class "ConsoleWindowClass" and with -- most likely -- "FoxPro Run Command" caption
- OS starts a process inside the console window
At this point VFP application should call FindWindow API function
DECLARE INTEGER FindWindow IN user32;
STRING lpClassName,;
STRING lpWindowName
passing either "ConsoleWindowClass" class name or "FoxPro Run Command" caption, or both as input parameter(s). The handle returned can be used for following SetParent call. The RUN shold be NOWAIT, otherwise the VFP application may halt until the issued RUN returns.
BTW, there's no guarantee that SetParent would work with console windows. On other occasions I found them to be very special animals :)