打印本文 打印本文 关闭窗口 关闭窗口
从当前的浏览器取得当前URL
作者:武汉SEO闵涛  文章来源:敏韬网  点击数687  更新时间:2009/4/23 18:44:13  文章录入:mintao  责任编辑:mintao

 

   确定在uses子句中增加DDEMan。


uses windows, ddeman, ......


function Get_URL(Servicio: string): String;
var
   Cliente_DDE: TDDEClientConv;
   temp:PChar; file://<<----------------这是新的
begin
    Result := '''''''';
    Cliente_DDE:= TDDEClientConv.Create( nil );
     with Cliente_DDE do
        begin
           SetLink( Servicio,''''WWW_GetWindowInfo'''');
           temp := RequestData(''''0xFFFFFFFF'''');
           Result := StrPas(temp);
           StrDispose(temp); file://避免内存漏洞
           CloseLink;
        end;
      Cliente_DDE.Free;
end;

procedure TForm1.Button1Click(Sender);
begin
   showmessage(Get_URL(''''Netscape''''));
      or
   showmessage(Get_URL(''''IExplore''''));
end;

打印本文 打印本文 关闭窗口 关闭窗口