Make sure you understand what 'fails' means in this context.
Failing here means 'fails to launch' or find the executable. It says nothing about the actual execution of the process however as ShellExecute is basically a fire and forget operation that doesn't wait for completion.
+++ Rick ---
>Hi,
>
>Is it correct that Shellexecute(), when fails, returns the value less than 32?
>
>I have the following code and want to be sure it is correct.
>
>
>lnResult =Shellexecute(0, tcCommand, tcFileName, tcParameter,tcDirectory,tnShowCommand)
>
>IF lnResult < 32
> DO CASE
> CASE lnResult=2
> cErrorMessage = "Invalid association or URL."
> CASE lnResult=31
> cErrorMessage = "No association."
> CASE lnResult=29
> cErrorMessage = "Can't start application."
> CASE lnResult=30
> cErrorMessage = "Application already open."
> OTHERWISE
> cErrorMessage = "No error information"
> ENDCASE
>ENDIF
>
>
>TIA