Don't display application errors

Posted in Application

Use SetErrorMode function with SEM_FAILCRITICALERRORS parameter. It allows your application don't display error messages, which can appears during executing of your application. In this example, you won't see error "Division by zero".

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Real;
begin
  SetErrorMode(SEM_FAILCRITICALERRORS);
  i:=1/0;
end;

For more
    Win32 Programmer's Reference

Download source