heartland
asked on
Launch a window application and wait for complete
Hi Expert,
Following code works fine if I want to launch an application program:
Sub LaunchApplication()
Dim iAppID As Integer = Shell(appPath, AppWinStyle.MaximizedFocus )
If System.IO.File.Exists(appP ath) = True Then
AppActivate(iAppID)
Endif
End Sub
However, If I want to launch an application and force the operation system to wait until the application has been terminated before allowing any other action to be performed. How do I do? I heard of ExecuteAndWait method. How does that work? The code will be in form_load event.
Thanks very much
heartland
Following code works fine if I want to launch an application program:
Sub LaunchApplication()
Dim iAppID As Integer = Shell(appPath, AppWinStyle.MaximizedFocus
If System.IO.File.Exists(appP
AppActivate(iAppID)
Endif
End Sub
However, If I want to launch an application and force the operation system to wait until the application has been terminated before allowing any other action to be performed. How do I do? I heard of ExecuteAndWait method. How does that work? The code will be in form_load event.
Thanks very much
heartland
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Fernando,
I tried your code and it did the exactly what I wanted. It is concise too. Thanks for help.
Hugh
I tried your code and it did the exactly what I wanted. It is concise too. Thanks for help.
Hugh
Glad I was able to help. :=)
It is WaitForExit. See an article I wrote in December 2003 from http://emoreau.s2i.com/
Cheers!