外壳IOleUndoManager [英] shell IOleUndoManager

查看:111
本文介绍了外壳IOleUndoManager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在资源管理器中删除文件时,以后可以撤消对文件的删除(还原).
即使启动第二个资源管理器实例,带有撤消命令的菜单也会正确更新
在这两种情况下.

我认为外壳内部使用了一个IOleUndoManager(服务).

当您更改目录和文件(复制,删除,重命名...)并使用IFileOperation时,

我的问题是,如何访问此IOleUndoManager?

我通过CLSID_FileOperation使用IFileOperation在文件系统中进行更改.
我的应用程序具有撤消和重做命令.我也希望我的用户能够撤消文件系统中的更改. IOleUndoManager拥有我需要的方法,并且我知道Shell会实现它.
如何访问此IOleUndoManager?

我在Vista32/Platform sdk上的尝试:

我创建了一个实例
然后从该浏览器中获取一个IServiceProvider.
然后我执行了services.QueryService(SID_SOleUndoManager,IID_IOleUndoManager);

但是我从中仅获得一个E_FAIL.

注意:我还编写了一个shell名称空间扩展,并且看到该shell
内部使用IOleUndoManager.在msdn中,我只能找到接口文档或示例以了解如何

When you delete a file in explorer, you can later undo the delete of the file (restore).
Even when you start a second instance of the explorer, the menu with the undo command is updated
correctly in both instances.

I think internaly the shell uses one IOleUndoManager (service).

when you make changes to directories and files (copy, delete, rename...) and use IFileOperation, then your changes are automaticly registered in the undoManager.

My question is, how can I access this IOleUndoManager?

I use IFileOperation via CLSID_FileOperation to make changes in the filesystem.
My application has a undo and redo command. And I also want my user be able to undo the changes in the filesystem. The IOleUndoManager has the methods I need, and I know the shell implements it.
How can I access this IOleUndoManager?

My try on Vista32/Platform sdk:

I create a instance of CLSID_ExplorerBrowser.
then I get a IServiceProvider from that browser.
then I do a  services.QueryService( SID_SOleUndoManager, IID_IOleUndoManager);

but i get only a E_FAIL from that..(Service not found).

Note: I also programmed a shell namespace extension and I see that the shell
uses internaly the IOleUndoManager.

in msdn i only find the interface documentation or samples how to interact with the UndoMgr from VisualStudio or with UndoMgr-Implementations for documents.

推荐答案

可能使用未记录的api(请参阅
Probably with undocumented apis (see Win32 api group for undocumented stuff)


这篇关于外壳IOleUndoManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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