Here's the example code:
Code: Select all
unit Unit1;
interface
implementation
uses
Windows, Dialogs, SysUtils, MadExcept;
procedure MyExceptEventHandler(frozen : boolean;
exceptObject : TObject;
exceptAddr : pointer;
crashedThreadId : dword;
var bugReport : string;
var screenShot : string;
var canContinue : boolean;
var handled : boolean);
begin
ShowMessage(0, 'Test', 'Test', MB_ICONERROR);
handled := True;
end;
initialization
RegisterExceptionHandler(MyExceptEventHandler, True);
raise Exception.Create('');
// after the above call, both my messagebox and both the mad dialog are shown
end.