如何获取有关类似IE收藏夹的API, 就是能够得到当前访问页面的host和title.(200分)

  • 主题发起人 主题发起人 Tethy
  • 开始时间 开始时间
T

Tethy

Unregistered / Unconfirmed
GUEST, unregistred user!
另,像Netants那样在IE中点右键, 能够添加到菜单并调用指定的程序
 
到msdn online看看,不需什么api,只要改改注册表就行了<br>look this :<br><br>Implementation Steps<br><br>The following steps are required to add an entry into the standard context menus in Internet Explorer.<br><br>1. Create a new key, using the text you want displayed in the context menu as the name, under: <br><br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt<br><br>The result should look like:<br><br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/&lt;MenuText&gt;<br><br>&lt;Menu Text&gt; should be replaced with the text that you want displayed in the context menu. The name can include an ampersand (&amp;) character, which will cause the character that follows to be underlined and used as a shortcut key.<br><br>2. Set the default value of the key to the URL of the page that contains the script you want the context menu entry to execute. This script can obtain the parent window object, the screen where the context menu item was executed, from the menuArguments property of the external object. <br><br>3. Optional. Create a binary value, Contexts, under: <br><br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/&lt;Menu ext&gt;<br><br>The result should look like:<br><br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/&lt;Menu Text&gt;/Contexts<br><br>Set the value of Contexts to indicate which contexts your entry should appear in the standard context menu by using a bit mask consisting of the logical OR of the following values:<br><br>Context Value <br><br>Default 0x1 <br>Images 0x2 <br>Controls 0x4 <br>Tables 0x8 <br>Text selection 0x10 <br>Anchor 0x20 <br><br>For example, if you want your context menu entry to appear in the default context menu and when the context is a text selection, set the value of Contexts to 0x11.<br><br>4. Optional. Create a DWORD value, Flags, under: <br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/&lt;Menu Text&gt;<br><br>The result should look like:<br><br>HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/&lt;Menu Text&gt;/Flags<br><br>Set the value of Flags to 0x1 to make the script run just as if it had been called through the showModalDialog method. Unlike the showModalDialog method, the script can access the window object of the parent window from the menuArguments property of the external object.<br><br>Strings stored inside a resource can be referenced by providing the path to the resource and reference identification in the format "path, resource_id". For example, if you wanted to use string resource 123 in Example.dll, you would use "Example.dll, 123".<br><br>
 
添加菜单到IE的菜单可以照control说的做.<br><br>你可以用DDE的方式得到当前IE的URL和Title(必须是当前浏览器已经载入该页面才有效),<br>下面的函数可以实现该功能:<br><br>参数说明:<br>&nbsp; sBrowerPrgFile: 浏览器exe文件的完整路径<br>&nbsp; sServiceName: 浏览器DDE服务的名字 'Netscape' 或'iexplore'<br>&nbsp; Netscape : boolean类型,确定是否是Netscape浏览器 <br>&nbsp; Title: 用来保存返回的title的文本<br>返回值: &nbsp;pChar类型的URL<br><br><br>function URLInfo(sBrowerPrgFile, sServiceName: string; Netscape: boolean; var Title: string): pChar;<br>var<br>&nbsp; DDEClientConv: TDDEClientConv;<br>&nbsp; StartPtr, EndPtr: pchar;<br>&nbsp; browserWinName: string;<br>begin<br>&nbsp; result:= #0;<br>&nbsp; Title:= '';<br><br>&nbsp; if (sBrowerPrgFile = '') or (not FileExists(sBrowerPrgFile)) then<br>&nbsp; &nbsp; &nbsp;raise EBrowserNotFoundError.create('浏览器程序不存在!');<br><br>&nbsp; ddeClientConv:= TDDEClientConv.Create( nil );<br>&nbsp; try<br>&nbsp; &nbsp; with ddeClientConv do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; ServiceApplication := sBrowerPrgFile;<br>&nbsp; &nbsp; &nbsp; SetLink( sServiceName,'WWW_GetWindowInfo');<br>&nbsp; &nbsp; &nbsp; StartPtr:= RequestData('0xFFFFFFFF');<br>&nbsp; &nbsp; end;<br>&nbsp; finally<br>&nbsp; &nbsp; ddeClientConv.Free;<br>&nbsp; end;<br><br>&nbsp; if startPtr^ = #0 then exit;<br><br>&nbsp; inc(StartPtr);<br>&nbsp; EndPtr:= StartPtr;<br><br>&nbsp; while (EndPtr^ &amp;lt;&amp;gt; '"') do<br>&nbsp; &nbsp; inc(EndPtr);<br><br>&nbsp; EndPtr^:= #0;<br>&nbsp; result:= StartPtr;<br><br>&nbsp; StartPtr:= EndPtr+3;<br>&nbsp; if Netscape then inc(StartPtr,12);<br><br>&nbsp; EndPtr:= StartPtr;<br><br>&nbsp; if Netscape then<br>&nbsp; &nbsp; &nbsp;while (EndPtr^ &amp;lt;&amp;gt; ']') do<br>&nbsp; &nbsp; &nbsp; &nbsp;inc(EndPtr)<br>&nbsp; else<br>&nbsp; &nbsp; &nbsp;while (EndPtr^ &amp;lt;&amp;gt; '"') do<br>&nbsp; &nbsp; &nbsp; &nbsp;inc(EndPtr);<br><br>&nbsp; EndPtr^:= #0;<br>&nbsp; Title:= strPas(StartPtr);<br>end;<br>
 
netscape如何添加菜单?
 
NE添加菜单不清楚,毕竟NE资料太少,而且也没看见有哪个软件把菜单添加到<br>NE上面了. :-(
 
这阵子cAkk可发了! &nbsp;:-)
 
多人接受答案了。
 
后退
顶部