* Using the VFP RUN command RUN /N NOTEPAD.EXE ? Is_Run32("NOTEPAD") && Displays zero * Using the Windows Script Host's Shell Object oShell = CREATEOBJECT("WScript.Shell") oShell.Run("NOTEPAD.EXE", 1) ? Is_Run32("NOTEPAD") && Displays zero * Using the old WinExec function in the API DECLARE INTEGER WinExec IN Win32API; STRING @lpexe, INTEGER uShowWnd = WinExec(("NOTEPAD.EXE", 1) ? Is_Run32("NOTEPAD") && Displays zeroAs near as I'm able to figure out, the problem is connected with VFP not being the active window when the call is made. There seems also to be, in the case of the Shell object a bit of a timing problem (the window hasn't been created yet).
* Using the VFP RUN command RUN /N7 NOTEPAD.EXE ? Is_Run32("NOTEPAD") && Displays the window handle * Using the Windows Script Host's Shell Object oShell = CREATEOBJECT("WScript.Shell") oShell.Run("NOTEPAD.EXE", 7) * Pause for a 1/10 of a second WAIT WINDOW "" TIMEOUT .1 ? Is_Run32("NOTEPAD") && Displays the window handle * Using the old WinExec function in the API DECLARE INTEGER WinExec IN Win32API; STRING @lpexe, INTEGER uShowWnd = WinExec(("NOTEPAD.EXE", 7) ? Is_Run32("NOTEPAD") && Displays the window handleOnce the window handle is correctly retrieved, the ShowWindow() API call may then be used to manipulate the window to the desired position. Documentation regarding this function is available in the API section.