Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

Getting Avtive URL From Current Browser

Title: Getting Avtive URL From Current Browser Question: How Can I Get The Default URL From The Browser To My APP Just Like Mirabilis ICQ Does ?? Answer: Try The Following Function !! And Be Sure To Add The DDEMan to your uses clause e.g )) uses windows, ddeman, ...... function Get_URL(Servicio: string): String; var Cliente_DDE: TDDEClientConv; temp:PChar; //begin Result := ''; Cliente_DDE:= TDDEClientConv.Create( nil ); with Cliente_DDE do begin SetLink( Servicio,'WWW_GetWindowInfo'); temp := RequestData('0xFFFFFFFF'); Result := StrPas(temp); StrDispose(temp); // CloseLink; end; Cliente_DDE.Free; end; procedure TForm1.Button1Click(Sender); begin showmessage(Get_URL('Netscape')); or showmessage(Get_URL('IExplore')); end; note )) IExplorer takes priority (( well, i think so ))