Ver código fonte

avoid dialog boxes on dll loading errors for windows

git-svn-id: trunk@6569 -
pierre 18 anos atrás
pai
commit
ffc571cd41
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      tests/utils/redir.pp

+ 3 - 0
tests/utils/redir.pp

@@ -983,6 +983,8 @@ end;
   {$ifdef win32}
     StoreInherit:=ExecInheritsHandles;
     ExecInheritsHandles:=true;
+    { Avoid dialog boxes if dll loading fails }
+    SetErrorMode(SEM_FAILCRITICALERRORS);
   {$endif win32}
     DosError:=0;
     If UseComSpec then
@@ -1000,6 +1002,7 @@ end;
       end;
   {$ifdef win32}
     ExecInheritsHandles:=StoreInherit;
+    SetErrorMode(0);
   {$endif win32}
     IOStatus:=DosError;
     ExecuteResult:=DosExitCode;