Hola pokoexperto1.
La función
ShellExecute devuelve un valor, que es mayor o igual a 32 cuando se ejecuta con éxito o, de modo contrario, representa el tipo de error.
Podrías intentar algo similar a este ejemplo:
Código Delphi
[-]
var
Msg: string;
Err: LongWord;
begin
Err := ShellExecute(Handle, 'open', 'descargar.htm', nil, nil, SW_SHOW);
if Err <= 32 then
begin
case Err of
2: Msg := 'File not found';
3: Msg := 'Path not found';
5: Msg := 'Access denied';
8: Msg := 'Out of memory';
26: Msg := 'Cannot share an open file';
27: Msg := 'File association information not complete';
28: Msg := 'DDE operation timed out';
29: Msg := 'DDE operation failed';
30: Msg := 'DDE operation is busy';
31: Msg := 'File association not available';
else
Msg := 'Unspecified Error';
end;
MessageBox(Handle ,PChar(Msg), '', MB_ICONERROR + MB_OK);
end;
Saludos