GetURLFromFirefox

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
ulu coder
Üye
Mesajlar: 838
Kayıt: 01 Nis 2006 06:46
Konum: Ankara

GetURLFromFirefox

Mesaj gönderen ulu coder »

S.A.

Açık olan InternetExplorer'lardaki URL'leri şu kodla alabiliyorum.

Kod: Tümünü seç

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;//GetURLFromIE

procedure TForm1.Button1Click(Sender: TObject);
begin
  EnumWindows(@GetUrlFromIE, LParam(ListBox1.Items));
end;
Firefox'dan da aynı şekilde URL'leri alabilmem için Firefox penceresinin ClassName'i vs. lazım. Bilgisi olan var mı?
Cevapla