| | |
Problem running multiple external apps
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
Hi,
I have a class that runs an external ap using shell then waits till the app is quit before carrying on.
Does anybody know if it is possible to start an app say by clicking a button then be told when the app has closed. The app can be open more than once.
The problem I have is when the code is run everything stops till the app has finished.
Hope this makes sense.
Here is the code I have so far:
I have a class that runs an external ap using shell then waits till the app is quit before carrying on.
Does anybody know if it is possible to start an app say by clicking a button then be told when the app has closed. The app can be open more than once.
The problem I have is when the code is run everything stops till the app has finished.
Hope this makes sense.
Here is the code I have so far:
VB.NET Syntax (Toggle Plain Text)
Public Function StartAndWait(ByVal ProcessPath As String, ByVal Licence As Integer) Dim startProcess As System.Diagnostics.Process Try startProcess = New System.Diagnostics.Process() startProcess.StartInfo.FileName = ProcessPath startProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal startProcess.Start() 'Wait until the process passes back an exit code startProcess.WaitForExit() ' Check Exit code to see if process finished without error. If startProcess.ExitCode <> 0 Then MessageBox.Show("Exit Code: " & startProcess.ExitCode) End If 'Free resources associated with this process startProcess.Close() StartAndWait = True Catch StartAndWait = False MessageBox.Show("Could not start process " & ProcessPath, "Error") End Try End Function
purpleGERBIL
I would try using Multi-Threading
Make the main thread continue running your application and the NEW Multi-Thread the open the other application
when the application is running the new thread will pause but your main app will continue to run also when the external app is closed the new thread will continue (add a msgbox in the new thread) and then the thread will close
Multi-Threading
http://www.taylorsnet.co.uk/SourceCo...px?SourceID=20
Make the main thread continue running your application and the NEW Multi-Thread the open the other application
when the application is running the new thread will pause but your main app will continue to run also when the external app is closed the new thread will continue (add a msgbox in the new thread) and then the thread will close
Multi-Threading
http://www.taylorsnet.co.uk/SourceCo...px?SourceID=20
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: How To alleviate two different date
- Next Thread: Help with buttons at runtime
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add arithmetic array assignment basic binary bing box button buttons center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel file-dialog firewall folder google hardcopy image images isnumericfuntioncall listview login math memory mobile ms msaccess mssqlbackend mysql navigate net networking opacity output pan peertopeervideostreaming picturebox picturebox1 plugin port print printpreview problemwithinstallation project record reports" reuse save savedialog serial sorting sql storedprocedure string temp text textbox timer toolbox updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf





