Url do Browse
23/11/2005
0
da forma que está, se eu tiver 5 sites abertos, mais só um ativo, ele pega todas as 5 urls.
Obrigada.
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*)
Renatacoimbra
Posts
24/11/2005
Michael
O que vc quer dizer com ´site ativo´? É a janela do IE com foco? Então seria a aplicação em primeiro plano sendo executada. Neste caso, vc pode usar a API [b:91186686f4]GetActiveWindow[/b:91186686f4], que retorna o Handle da janela ´focada´. Com ela, basta adaptar o código acima.
[]´s
24/11/2005
Renatacoimbra
Você pode me auxiliar com essa adaptação, não sei como fazer.
Obrigada.
24/11/2005
Mahdak
uses ddeman; function GetURL(Service: string): String; var ClDDE: TDDEClientConv; temp:PChar; begin Result := ´´; //create a new DDE Client object ClDDE:= TDDEClientConv.Create( nil ); with ClDDE do begin SetLink(Service,´WWW_GetWindowInfo´); temp := RequestData(´0xFFFFFFFF´); Result := StrPas(temp); StrDispose(temp); CloseLink; end; ClDDE.Free; end; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(GetURL(´IExplore´)); end;
24/11/2005
Renatacoimbra
Com o IE funcionou legal.
Eu não tenho instalado, mais se eu fizer assim:
ShowMessage(GetURL(´FireFox´)); será se funciona tb ?
Obrigada.
08/12/2005
Ramms
Funciona sim
11/01/2008
Facc
Funciona sim[/quote:44c820695e]
Revivendo o topico
Como faço pra pegar o Avant Browser? Já tentei Avant, AvantBrowser sem sucesso
25/03/2008
Cyborg*
Funciona sim[/quote:ed1789dc39]
Revivendo o topico
Como faço pra pegar o Avant Browser? Já tentei Avant, AvantBrowser sem sucesso[/quote:ed1789dc39]
Faço a mesma pergunta 8)
26/03/2008
Facc
Funciona sim[/quote:96db1ee33f]
Revivendo o topico
Como faço pra pegar o Avant Browser? Já tentei Avant, AvantBrowser sem sucesso[/quote:96db1ee33f]
Faço a mesma pergunta 8)[/quote:96db1ee33f]
Dê uma olhada nesse tópico
[url]http://forum.devmedia.com.br/viewtopic.php?p=307735#307735[/url]
Clique aqui para fazer login e interagir na Comunidade :)