VB.NET - Newly threaded process with communication?

Larry

New member
I have an application sending arguments to a command line application. Now normally, the command line program says "File is already done." or "Selecting settings:" after processing each file.
Now, I need my main app to wait till the comline says one of these, then Listbox1.Items.RemoveAt(0) (to remove the first item in the list).

Now that is rather simple, but I need my program to start the comline on a separate thread because currently, my program freezes when the comline is started.

Here's part of the code:

Dim pp As New ProcessStartInfo
pp.FileName = Mid$(My.Computer.FileSystem.SpecialDirectories.Desktop, 1, 1) & ":\optipng.exe"
pp.Arguments = "-o" & lang.Text & lists
pp.WindowStyle = ProcessWindowStyle.Hidden
Dim crusher As Process = Process.Start(pp)
crusher.StartInfo.CreateNoWindow = True
Me.Text = "Optimising..."
Me.ControlBox = False
crusher.Start()
crusher.WaitForExit()
Me.ControlBox = True
Me.Text = "PUNIG 0.6.4"

Please help with the multi-threading at least!
 
Back
Top