Visual Basic 'WaitForExit' Problem

Associate
Joined
9 Sep 2008
Posts
40
Location
Moira, East Midlands
..and another hurdle to overcome!

Hi Everyone,

I am using the following code in my vb build:

Dim myProcess As Process
Dim myProcessinfo As New ProcessStartInfo("C:\processname")
myProcessinfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess = Process.Start(myProcessinfo)

myProcess.WaitForExit(360000)
If Not myProcess.HasExited Then
myProcess.Kill()
End If

Everything works ok, the process runs and if it hasn't ended within 6 minutes it's automatically stopped.

Now the problem!

As i'm using the WaitForExit command the whole build does just that - it stops, dead.
I have a progress bar and a flash advert that both stop dead in their tracks until the process is finished - not good!

Is there any way I can get VB to wait until the process has finished before the next step commences, retain some control that prevents the process from hanging and also have animations still play?

TIA guys.
 
Back
Top Bottom