使用BHO扩展Windows资源管理器 [英] Extend Windows explorer with BHO

查看:1108
本文介绍了使用BHO扩展Windows资源管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用C ++中的自定义面板扩展whindows explorer(NOT IE),它应该看起来像这样:

I am trying to extend whindows explorer (NOT IE) with a customized panel in C++, which should look like this:

这里有一个类似的问题,我在C# b $ b 类似问题

and here's a similar question I found (in C#) : Similar question

问题是C#,并已经得到了答案。

The question is of C# and already got an answer.

但我自己发现的答案有点太简短,我不能跟随,这里是我得到:

But I myself find the answer is a bit too brief for me to follow, here's what I got:


  1. 我应该实现一个BHO对象

  2. BHO对象应该实现IObjectWithSite和IDockingWindow

  3. QueryInterface 以获取服务提供者的指针,然后调用 QueryService 以获取Docking窗口框架的指针,最后调用 AddToolBar 添加我的自定义窗口。 这里是我迷路的地方
  1. I should implement a BHO object
  2. the BHO object should implemet IObjectWithSite and IDockingWindow
  3. In SetSite method, call QueryInterface to get the pointer of service provider, then call QueryService to get the pointer of a Docking window frame, then finally call AddToolBar to add my customized window. and here's where I got lost

,我的问题是:


  1. 我应该在什么时候创建自定义窗口?在对象初始化期间?

  2. 我想我应该得到一个父窗口的句柄(在我的情况下,我认为它应该是windows explorer的句柄),然后我可以创建自己的窗口作为它的孩子,在哪里可以得到这个句柄?

  3. 如何注册我的dll?我读了一些预览处理程序的示例代码,我们必须在系统调用之前正确注册dll?

I试图重现类似问题的日子,但现在没有运气。

I've tried to reproduce what the similar question said for days, but no luck by now.

我真的很喜欢BHO和所有这些东西,请帮助我

I'm really new to BHO and all such stuff, kindly please help me out of this, thanks.

推荐答案

对于这样的Explorer扩展,我创建2个对象。首先实现BHO(IDispatch和IObjectWithSite)。第二个实现IObjectWithSite,IOleWindow,IDockingWindow,IInputObject和IOleCommandTarget。

For such Explorer extension I create 2 object. First implements BHO (IDispatch and IObjectWithSite). Second implements IObjectWithSite, IOleWindow, IDockingWindow, IInputObject and IOleCommandTarget.

1)你的窗口显示的逻辑取决于你想实现什么。

1) The logic of showing of your window depends on what you want to realize.

2)父窗口你可以在里面Second.SetSite:

2) Parent window you can get inside Second.SetSite:

Site.QueryInterface(IDockingWindowSite, FDockingWindowSite);
FDockingWindowSite.GetWindow(FParent);

3)只需将BHO注册为标准BHO。

3) Just register your BHO as standard BHO.

我花了很长时间来创建和调试这样的扩展。如果你不是专家在这个领域再想想 - 你真的需要这个功能。但如果你真的决定你需要,那么尝试创建和注册简单的BHO第一。只有当BHO正常工作时,才能添加IDockingWindow实现。

It took a LONG time for me to create and debug such extension. If you are not expert in this sphere think again - do you really need this functionality. But if you really decided you need then try to create and register simple BHO first. And only when BHO works correctly add IDockingWindow implementation.

这篇关于使用BHO扩展Windows资源管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆