Mas se fosse no Mozilla Firefox como seria?

Delphi

08/07/2006

Queria saber como pegar a url de um site? Pois pretendo redirecionar a url se a mesma não for permitida. No internet explorer já consigo pegar a url e redirecionar, mas não estou conseguindo, fazer o mesmo no navegador Mozilla Firefox. O que devo fazer alguém tem alguma sugestão?

Peguei o codigo abaixo neste, forum e alterei conforme minhas necessidades, mas no Firefox não consigo, alguma sugestão?

 function GetUrlFromIE (Handle: THandle; List: TStringList):
 boolean; stdcall;
var
  hWndIE, hWndIEChild : HWND;
  Buffer : array[0..255] of Char;
begin
  //get the window caption
  SendMessage(Handle, WM_GETTEXT, 255, integer(@Buffer[0]));
  //look for the Internet Explorer window with "Buffer" caption
  hWndIE := FindWindow(´IEFrame´, Buffer);
  if hWndIE > 0 then
begin
    //try to get a handle to IE´s toolbar container
    hWndIEChild := FindWindowEx(hWndIE, 0, ´WorkerW´, nil);
    if hWndIEChild > 0 then
    begin
      //get a handle to address bar
      hWndIEChild := FindWindowEx(hWndIEChild, 0, ´ReBarWindow32´, nil);
      if hWndIEChild > 0 then
      begin
        //finally, locate combo box and add its text to the list
        hWndIEChild := FindWindowEx(hWndIEChild, 0, ´ComboBoxEx32´, nil);
        if hWndIEChild > 0 then
        begin
          SendMessage(hWndIEChild, WM_GETTEXT, 255, integer(@Buffer));
          //List.AddObject(Buffer,TObject(hWndIE));
          List.Add(Buffer)
        end;
      end;
    end;
  end;
  //continue enumeration
  Result :=True;
end;


Obrigado


Ranyeryfip

Ranyeryfip

Curtidas 0
POSTAR