popuperr.pp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. { mswindows is defined for win32 and win64 targets }
  16. {$ifdef mswindows}
  17. uses
  18. windows;
  19. {$endif mswindows}
  20. {$IFDEF OS2}
  21. function _DosError (Error: longint): longint; cdecl;
  22. external 'DOSCALLS' index 212;
  23. {$ENDIF OS2}
  24. begin
  25. {$ifdef mswindows}
  26. SetErrorMode(
  27. SEM_FAILCRITICALERRORS or
  28. SEM_NOGPFAULTERRORBOX or
  29. SEM_NOOPENFILEERRORBOX);
  30. {$endif mswindows}
  31. {$IFDEF OS2}
  32. if os_Mode = osOS2 then _DosError (0);
  33. {$ENDIF OS2}
  34. end.