ShellExecute without Security Warning

2

How to run an application with ShellExecute and prevent Windows from issuing the "Security Warning"?

Is there any parameter that can be sent to prevent the warning? I have tried to apply some in searches that I did on the web but none proved satisfactory.

    
asked by anonymous 08.08.2016 / 13:52

1 answer

2

Yes. And you'll have to use ShellExecuteEx .

You can temporarily disable the environment variable SEE_MASK_NOZONECHECKS :

  

Do not perform a zone check. This flag allows ShellExecuteEx to   bypass zone checking put into place by IAttachmentExecute .

To use it, do so:

Uses
  ShellApi;
//...

function executarArquivo(const arquivo: string): LongBool;
Var
  SE: TShellExecuteInfo;
begin
  SE.cbSize := SizeOf(SE);
  SE.fMask := SEE_MASK_NOZONECHECKS;
  SE.lpFile := pchar(arquivo);
  SE.nShow := SW_SHOWNORMAL;
  //SE.lpVerb := 'runas'; // Para executar o programa como admin

  Result := ShellExecuteEx(@SE);
end;
    
08.08.2016 / 14:37