Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pls Help .. Mr.Ed Rauh's FAQ ID: 7789 , api_apprun
Message
From
23/03/2004 08:01:28
 
 
To
23/03/2004 03:25:13
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00888760
Message ID:
00888807
Views:
99
>pls see the command I am using in my application, this is working fine, but the problem is before completing the process(imrun.exe) the statement " wait wind 'Done'" is executing. to solve this problem I did lot of search in user forums, as the result I got a thread FAQ ID: 7789 from universaltheard.com written by Mr.Ed Rauh. I thought of using his codes to solve my problem, But even then I am not getting what I want. I am sure that class is capable of doing this , somewhere I am doing something wrong, pls see the code I have written to utilize Ed Rauh's class(after the '*****'). My requirement is to execute the statement 'Wait Wind 'Done'" only after the exit of imrun.exe.
>looking for a solution from someone. please help
>Thanks in advance
>
>jijo david
>
>DECLARE INTEGER ShellExecute IN shell32.dll ;
>INTEGER hndWin, ;
>STRING cAction, ;
>STRING cFileName, ;
>STRING cParameters, ;
>STRING cDirectory, ;
>INTEGER nShowWin
>ShellExecute(0,"open","C:\Program Files\Microsoft Business Solutions\Integration Manager\imrun","/i ScEvaInv","",1)
>
>wait wind 'Done'
>***************************
>
>*SET PROCEDURE TO Process ADDITIVE
>*ShellExecute(0,"open","C:\Program Files\Microsoft Business Solutions\Integration Manager\imrun","/i ScEvaInv","",1)
>*oProcess = CREATEOBJ('API_AppRun','NOTEPAD.EXE ','C:\','NOR')
>oProcess = CREATEOBJ('API_AppRun','C:\Program Files\Microsoft Business Solutions\Integration Manager\imrun.exe /i ScEvaInv','','NOR')
>*Run the application and don't wait to terminate
>oProcess.LaunchApp()
>*Check the exit status; 259 means still running
>DO WHILE oProcess.CheckProcessxitCode() = 259
>wait window 'Still running' nowait
>ENDDO
>WAIT WINDOW 'done'
>RETURN


To run programs synchronously (e.g. wait until the other one ends), I use Windows Script Host.
See: http://fox.wikis.com/wc.dll?Wiki~WindowsScriptingHost

Something like:
#define SW_SHOW_NORMAL 1
#define SW_SHOW_MINIMIZED 2
#define SW_SHOW_MAXIMIZED 3
oShell = createobject("WScript.Shell")
oShell.Run("C:\Program Files\Microsoft Business Solutions\Integration Manager\imrun.exe /i ScEvaInv",SW_SHOW_NORMAL,.T.)
HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform