popuperr.pp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {
  2. This file is part of the Free Pascal test suite.
  3. Copyright (c) 1999-2004 by the Free Pascal development team.
  4. Used to avoid getting pop up windows for critical errors under Windows
  5. and OS/2 operating systems (extension of win32err unit by Pierre Muller).
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit popuperr;
  13. interface
  14. implementation
  15. {$ifdef win32}
  16. uses
  17. windows;
  18. {$endif win32}
  19. {$IFDEF OS2}
  20. function _DosError (Error: longint): longint; cdecl;
  21. external 'DOSCALLS' index 212;
  22. {$ENDIF OS2}
  23. begin
  24. {$ifdef win32}
  25. SetErrorMode(
  26. SEM_FAILCRITICALERRORS or
  27. SEM_NOGPFAULTERRORBOX or
  28. SEM_NOOPENFILEERRORBOX);
  29. {$endif win32}
  30. {$IFDEF OS2}
  31. if os_Mode = osOS2 then _DosError (0);
  32. {$ENDIF OS2}
  33. end.