开发者

Accessing IExplorerCommandProvider from IShellFolder

开发者 https://www.devze.com 2023-01-23 09:23 出处:网络
I am writing an Explorer extension for Vista and Windows 7. I read that if you are making a namespace extension you can provide your own commands using IExplorerCommandProvider. This is done in respon

I am writing an Explorer extension for Vista and Windows 7. I read that if you are making a namespace extension you can provide your own commands using IExplorerCommandProvider. This is done in response to IShellFolder::CreateViewObject.

I am not writing a namespace extension, but a toolbar that lets you perform operations in Explorer. So I need to get IExplorerCommandProvider from an existing IShellFolder.

I get IShellView from the IShellBrowser, then I convert it to IFolderView, then I get IShellFolder. So far so good. I get a valid folder pointer开发者_如何学C.

This however doesn't work:

pShellFolder->CreateViewObject(NULL,IID_IExplorerCommandProvider,&p); // returns E_NOINTERFACE

I tried passing different values for the hwnd parameter of CreateViewObject, starting with the file pane and going all the way up to the top level Explorer window, and none of them worked.

So my questions are:

1) Do regular file system folders even support IExplorerCommandProvider?

2) If they do, how do I get my hands on that interface?

Thanks

Ivo

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号