A
AntSalc
Guest
I use the following loop to wait for the end of some previously launched processes:
For i = StartProgram To p.Length - 1
While Not proc(i).HasExited
Sleep(100)
End While
Next
The problem that I have is that some of the proc(i) processes have changed from Console to WPF apps. These new apps contain windows with websites that I would like to access when the app has ended.
Before, with the console apps, once the application had ended, the console would close but the website would stay open and The loop above would work well.
Now, however, with the new WPF apps the loop above only works if I quit the apps programmatically which means losing the website access.
A workaround is to have each process write to a file a code when it has reached the end and then use a similar loop as above checking with a streamreader for that code.
That is very convoluted.
Any better way to do it?
The option of writing the new apps in Console form is not an option. The website control, WebView2, is not available for console apps.
Continue reading...
For i = StartProgram To p.Length - 1
While Not proc(i).HasExited
Sleep(100)
End While
Next
The problem that I have is that some of the proc(i) processes have changed from Console to WPF apps. These new apps contain windows with websites that I would like to access when the app has ended.
Before, with the console apps, once the application had ended, the console would close but the website would stay open and The loop above would work well.
Now, however, with the new WPF apps the loop above only works if I quit the apps programmatically which means losing the website access.
A workaround is to have each process write to a file a code when it has reached the end and then use a similar loop as above checking with a streamreader for that code.
That is very convoluted.
Any better way to do it?
The option of writing the new apps in Console form is not an option. The website control, WebView2, is not available for console apps.
Continue reading...