WaitForExit

  • Thread starter Thread starter moley_cruz
  • Start date Start date
M

moley_cruz

Hi,
I am using WaitForExit to wait for an external batch file to finish
executing.
Why does WaitForExit freeze my vb form ?
thanks
 
Why does WaitForExit freeze my vb form ?

Because as documented, WaitForExit "blocks the current thread of execution"
and you presumably execute WaitForExit on the form's thread. If you want
your form unfrozen and don't really need to wait on the batch file, then
don't use WaitForExit. If frozen is ok and you need to wait, then you might
change the mouse cursor to an hourglass until the batch file completes. If
you really need to wait for exit and you really need your form unfrozen, then
start a new thread to execute the batch file.
 
how to change the mouse cursor to an hourglass ?

xxx.Cursor = Cursors.WaitCursor

where xxx is a form or a control.
 
Back
Top