Using WinExec to execute another program.

I have need to run a DOS program from my Delphi Program, I am using the
following:

ProgExec := WinExec( ProgName, sw_show );

Case ProgExec of

       { list of error codes returned by WinExec }

ELSE
      { Comes here if the code is greater than 32--which means it was
successful }

      MessageBox( "Conversion Successful ", MB_TaskModal + MB_ICONOK )  <<
not really the code but this message should show up here.

My problem is that before the DOS program can execute the MessageBox pops
up on the screen, usually it just goes away and the DOS program executes in
its window--sometimes it is MODAL (you have to click on the "OK" button)
before the DOS program will run.

Sometimes, on return you have to physically click on the CLOSE button to
close the DOS window before execution continues, other times the above
MessageBox pops up and you click on the "OK" buttton to proceed with the
program.

Any reasons why??!!??

Bill Burt, Jr.
BBur...@AOL.COM