I am using ShellExecute to run external application
How can i tell when the external application ends ?
Here my code
theProgram := 'MySql.exe';
itsParameters := ' -u user1 -ppassword -e "create database abc"’;
rslt := ShellExecute(0, 'open',
pChar (theProgram),
pChar (itsParameters),
nil,
SW_SHOW);
Try the following function. WaitForSingleObject does what you need.