如何定制Windows资源浏览器的工具条

jiangshx 2003-12-27 05:18:54
类似3721上网助手、百度搜霸、Google工具条之类的,如何制作,哪位老大有这方面的经验,提供一点思路可以吗?
...全文
24 点赞 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangguo_god 2004-01-02
方法是一样的
回复
remily 2003-12-31
他要的不是添加按钮的,他要的是 添加一个工具条的那种
回复
yangguo_god 2003-12-30
帖子太长了,不想贴,你下载一个delphi超级猛料,里面有详细介绍
回复
yangguo_god 2003-12-30
Download the code (13KB)
定制IE 5.0

Dino Esposito

张中华 翻译讲解

==============

张某前言:金山词霸、网络蚂蚁这些软件是怎么在IE5.0里添加工具条按钮和右键菜单呢?读了Dino Esposito的这篇文章,你就一清二楚了。你可以只看中文翻译讲解部分,如不能充分理解明白,请看对照的原文。

本文原文在MSDN网站上有:

Dino Esposito, "Customizing Microsoft Internet Explorer 5.0", MIND, 1999年11月期

在MSDN中的路径为:

Periodicals | Periodicals 1999 | Microsoft Internet Developer | November

MSDN中,关于IE应用开发的更多信息位于:

Platform SDK | Web Services | Workshop | Reusing Browser Technology

由于这里不能放图片,建议看译者网a站上的:

http://zzh-cn.com

==============

Nowadays, writing a completely custom browser is not a difficult task—provided you can rely on the WebBrowser control that's available starting with Microsoft?Internet Explorer 3.0. The browser helper objects (BHO) introduced with Internet Explorer 4.0 gave you an opportunity to add even complex new functionality to the original browser. A couple of working examples of BHOs can be found in Scott Roberts' article in the May 1998 issue of MIND and in the January/February 1999 issue of MSDN?News.

==============

翻译讲解:有哪些技术、工具可用来定制IE浏览器呢?从IE3.0开始提供的WebBrowser control,从IE4.0开始提供的Browser Helper Objects(BHOs),就是让开发人员用来定制IE的。Scott Roberts和Dino Esposito写有BHOs相关的介绍文章:

Scott Roberts, "Controlling Internet Explorer 4.0 with Browser Helper Objects", MIND, 1998年5月期

Dino Esposito, "Browser Helper Objects: The Browser the Way You Want It", MSDN News, 1999年1/2月期

==============

There is just one aspect missing from all these pre-Internet Explorer 5.0 programming goodies: you couldn't associate new functionality with the browser's user interface. You had no way to add new toolbar buttons or to customize any of the menus. Thankfully, this problem has been solved with Internet Explorer 5.0.

==============

翻译讲解:但是这些IE5.0之前的技术有个缺点:就是你不能把功能和用户界面联系起来,即你不能往工具条上增加按钮,也不能往菜单里增加菜单项。谢天谢地,IE5.0解决了这些问题。

==============

Let's look at the new ways you can interface with the Internet Explorer UI, the points at which you're allowed to intervene, and what you can actually obtain through code. I'll briefly review the highlights of BHOs, focusing on scripting-related aspects of Internet Explorer 5.0 customization and registry changes. Windows Script Host (WSH) will be my development environment of choice here.

==============

翻译讲解:现在就让我们看看是怎么做的,本文使用的开发环境为Windows Script Host(WSH)。

==============

Customizable Aspects of Internet Explorer 5.0

Figure 1 summarizes the aspects of Internet Explorer 5.0 that can be considered customizable. In particular, you can add new toolbar buttons and menu items. For each, you specify the text and icons to add to the particular object, as well as the code that you should run when the user selects the new entry. The browser has a number of context menus that appear when you right-click an image, a document, a table, an ActiveX?control, selected text, and other items. You can add new items to any of the context menus and have full control over the whole process that displays the menu. In other words, you can detect when the context menu is about to be shown and add your changes on the fly.

==============

翻译讲解:Figure 1概括了IE5.0可定制的方面。最令人关注的就是可增加工具条按钮和菜单项。右键点击弹出的菜单叫context menu,也可以往里面增加菜单项。

==============

Internet Explorer 5.0 comes with a number of related applications that let you work outside the Web, such as email or news readers, HTML editors, and so on. You can modify the list of available applications to fit your needs. The search bar can be enhanced and you can even use your own search panel.

==============

翻译讲解:和IE5.0相关的程序还有电子邮件和新闻阅读器(OutlookExpress),网页编辑器(FrontPage)等。在Internet选项对话框中程序那一栏里,有个列表列出可供选择的程序,你可以把你喜爱的程序(Foxmail, Dreamweaver)加入列表中。

==============

Technologies like Dynamic HTML (DHTML), behaviors, and XML provide excellent tools for customizing and extending browser features. You can create a browser implementing the IDocHostUIHandler interface, and expose a completely custom object model through that interface's External property (see "Take Total Control of Internet Explorer with Advanced Hosting Interfaces," by Scott Roberts in the October 1998 issue of MIND). You can use behaviors to customize the way a certain HTML tag reacts to user and browser solicitations by extending it with new methods, properties, and events.

==============

翻译讲解:用来定制或扩展浏览器的技术有动态HTML(DHTML), behaviors, XML等。例如,通过实现一个IDocHostUIHandler 接口可以创建一个浏览器,参见:

Scott Roberts, "Take Total Control of Internet Explorer with Advanced Hosting Interfaces", MIND, 1998年10月期

==============

Customization Techniques

Customization of the Internet Explorer 5.0 user interface involves four elements: COM components, HTML, script files, and the registry. By writing a special COM component or script file and entering some keys and values to the registry, you can personalize the Internet Explorer interface. As I mentioned earlier, I won't discuss the COM stuff in depth here, but I will give you an overview of the COM component you can write to interact with Internet Explorer 5.0.

==============

翻译讲解:定制IE5.0涉及4种元素:COM组件,HTML,Script文件,注册表。往注册表里添加一些Keys和Values,写一个特定的COM组件或Script文件,就可以定制IE的界面了。

==============

There are basically four types of Internet Explorer-specific COM objects: BHOs, BHOs with custom commands, command-only objects, and the Explorer deskband.

==============

翻译讲解:基本上,与IE相关的COM object有4种类型:BHOs,带定制命令的BHOs,command-only objects,Explorer deskband。

==============

A BHO is a simple COM server that is only required to implement the IObjectWithSite interface. You can create a BHO with ATL by choosing the Internet Explorer object template from the ATL objects gallery. BHOs are also supported by Windows Explorer (if you're running shell version 4.71 or greater) and Internet Explorer 4.0. BHOs don't necessarily link with the UI; they are just actions you take when starting the browser. BHOs are passed a pointer to the browser's IUnknown interface.

==============

翻译讲解:一个BHO是一个简单的COM server,只需实现IObjectWithSite接口即可。可以用ATL创建一个BHO,从ATL objects gallery中选择Internet Explorer object template。Windows Explorer和IE4.0也支持BHOs。BHOs并不和UI相连,它只是在浏览器启动时起作用。BHOs会接收到一个指向浏览器IUnknown接口的指针。

==============

You can add new commands to the browser by writing BHOs, or even simpler COM objects, that implement IOleCommandTarget. With this interface, Internet Explorer 5.0 knows how to ask your component to execute a function. Such a component needs to be associated with a menu item or a toolbar button. The difference between a BHO and a COM server implementing IOleCommandTarget is that a BHO can easily access (via the received IUnknown pointer) any object model exposed by the document being viewed.

==============

翻译讲解:如果要往浏览器里加入命令,那么写BHOs,或更简单的COM object时,要实现IOleCommandTarget接口。IE5.0通过这个接口和你的组件交互并执行某项功能。这种组件需要和一个菜单项或一个工具条按钮联系起来。这种实现IOleCommandTarget接口的COM server和前面介绍的实现IObjectWithSite接口的BHOs的区别是:实现IObjectWithSite接口的BHO可以很容易地访问正被浏览的文档中的object model(这是因为上面说到过的,它会接收到一个指向浏览器IUnknown接口的指针)。

==============

回复
jiangshx 2003-12-30
求救斑竹,有没有办法帮一下。领导给我出难题,我只好求各位了。
回复
constantine 2003-12-27
我也不会,顶
回复
geniusdhc 2003-12-27
不会,顶
回复
发动态
发帖子
Windows SDK/API
创建于2007-08-02

1202

社区成员

C++ Builder Windows SDK/API
申请成为版主
社区公告
暂无公告