[DUG] Shellexecute issues in Delphi - call hangs until the program it starts finishes.

John Bird johnkbird at paradise.net.nz
Fri Dec 12 14:17:00 NZDT 2008


There are a number of possibilities - for instance on Vista the Program1 
could be triggering UAC.

Or there could be an error in invoking Shellexecute you are not seeing - try 
some code like:

  if ShellExecute(Application.Mainform.Handle, 'open', Pchar(aProgName), 
PChar(aparaml), PChar(aDir), SW_SHOWNORMAL) <= 32 then
    ShowMessage('Shellexecute error:' + aProgName + spc + aparaml + spc + 
aDir + #13 + #10 + SysErrorMessage(GetLastError));

And see if it tells you more.  I suspect there is an error message you are 
not seeing.

John



More information about the Delphi mailing list