procedure TfmMain.WMActivate(var Msg: TWMActivate);
var
  S: String;
  wnd: HWND;
  I: Integer;
begin
  if (Msg.Active = 0) then
   begin
    wnd := Msg.ActiveWindow;

    I := GetWindowTextLength(wnd);

    SetLength(S, I + 1);
    GetWindowText(Wnd, PChar(S), I + 1);

    if ((miViewDisableScriptErrors.Checked) and (StrPos(PChar(UpperCase(S)),
PChar('SCRIPT')) <> nil)) then
     begin
      //User doesn't want to see error boxes
      Sendmessage(wnd,WM_CLOSE,0,0);
      exit;
     end;

    SendMessage(wnd, WM_SETICON, ICON_SMALL, Application.Icon.Handle);

    //You'll have to change the next two lines for Mozilla, I believe
    S := StringReplace(S, 'Microsoft ', '', []);
    S := StringReplace(S, 'Internet Explorer', 'Vapor', []);

    SetWindowText(Wnd, Pchar(S));
   end;
end;

"Tomasz Pyra" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When Mozilla execute JavaScript code with errors, it shows dialog
> 'JavaScript Error'.
>
> How to prevent from showing that message box, and write own function to
> handle errors?


_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to