>Hi George,
>
>This is what I'm doing:
>
>* Pararameters passed to the program
>cpram_string = " " + ALLTRIM(STR(nno_employe, 11)) + ' ' + ALLTRIM(STR(nuser_lingo)) + ' ' + ALLTRIM(STR(node_cursor.security, 12))
>* Path of the program
>cpath_name = SYS(5) + SYS(2003) + "\" + ALLTRIM(node_cursor.exe_name)
>* Run command with the path & parameters
>cexe_macro = "!/N " + cpath_name + cpram_string
>* Execute the run command
>&cexe_macro
>
Mike,
You'll have to get the window handle immediately after executing the macro, then use that to shut down the other applications. What I'd suggest here is using a loop to make the calling program wait until the program being executed initialized and its window appeared. I'd store the window handle for shutting down later. In order to determine if the other program was still executing, I'd use the IsWindow() API function (sample below). If the window doesn't exist, shut down the other application.
DECLARE INTEGER IsWindow IN Win32API;
INTEGER hWnd
llresult = (IsWindow(lnhwnd) # 0)
llresult will be .T. or .F. depending on whether or not the window exists.
George
Ubi caritas et amor, deus ibi est