给你一个函数:<br><br>function URLInfo(sBrowerPrgFile, sServiceName: string; Netscape: boolean; var Title: string): pChar;<br>{<br>参数说明:<br> sBrowerPrgFile: 浏览器exe文件的完整路径名<br> sServiceName: 浏览器的DDE-Service名字<br> Netscape是'Netscape',IE是'iexplore'<br> Title: 返回当前网页的title<br> 返回值: pChar的字符串<br>}<br>var<br> DDEClientConv: TDDEClientConv;<br> StartPtr, EndPtr: pchar;<br> browserWinName: string;<br>begin<br> result:= #0;<br> Title:= '';<br><br> if (sBrowerPrgFile = '') or (not FileExists(sBrowerPrgFile)) then<br> raise EBrowserNotFoundError.create('****!浏览器应用程序不存在!');<br><br> ddeClientConv:= TDDEClientConv.Create( nil );<br> try<br> with ddeClientConv do<br> begin<br> ServiceApplication := sBrowerPrgFile;<br> SetLink( sServiceName,'WWW_GetWindowInfo');<br> StartPtr:= RequestData('0xFFFFFFFF');<br> end;<br> finally<br> ddeClientConv.Free;<br> end;<br><br> if startPtr^ = #0 then<br> exit;<br> {skip leading "}<br> inc(StartPtr);<br> EndPtr:= StartPtr;<br> {proceed to next "}<br> while (EndPtr^ <> '"') do<br> inc(EndPtr);<br> {terminate URL string}<br> EndPtr^:= #0;<br> result:= StartPtr;<br> {skip ","}<br> StartPtr:= EndPtr+3;<br> if Netscape then<br> inc(StartPtr,12);<br><br> EndPtr:= StartPtr;<br> if Netscape then<br> while (EndPtr^ <> ']') do<br> inc(EndPtr)<br> else<br> while (EndPtr^ <> '"') do<br> inc(EndPtr);<br><br> EndPtr^:= #0;<br> Title:= strPas(StartPtr);<br>end;<br>