额外的Windows内存 [英] extra windows memory

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

问题描述

每当用户在Windows资源管理器中选择一个或多个文件或文件夹并右键单击以剪切或复制所选对象时,
我必须禁用特定类型文件的弹出菜单的剪切和复制选项(即,扩展名为.doc的文件,弹出菜单不应显示剪切或复制选项).


是的,我知道我必须处理WM_INITMENUPOPUP消息.
但是我怎么知道当前在Window Explorer应用程序中选择了什么.

我不知道,Windows资源管理器的窗口额外内存中包含什么?

从那里我可以获取所选对象的列表,以便可以正确处理WM_INITMENUPOPUP?

有人可以给我指导吗?

在此先感谢.

Whenever a user select one or more files or folders in windows explorer and right click to cut or copy the selected objects,
i have to disable pop up menu''s cut and and copy options for particular type of files(i.e for file having .doc extension , pop up menu should not display cut or copy options).


Ya, i know that i have to process WM_INITMENUPOPUP message.
but how could i know what is currently selected in Window explorer application.

I don''t know ,what window-extra-memory of windows explorer does contain?

from where i can get list of objects selected so as i can correctly process WM_INITMENUPOPUP ?

Can any one give me guidance?

Thanks in Advance.

推荐答案

这应该为您提供一个演练:
就是说,如果您认为上下文菜单可以提供某种文件保护,请再考虑一下:不管用Shell做什么,它都不会.

最后,我不确定您是否真的需要做这项工作(除非您想通过Shell接口注册真正重要的应用程序才能工作;一个非常成功的例子就是TortoiseSVN这样的方法,
This should provide you with a walk-through: Use Shell Context Menu in your applications[^].

Note some things: it has nothing or almost nothing to do with "extra Windows memory"; I have no idea why you consider these concerns related. Right term for the menu is "Context menu". Prefer disabling of the items to hiding them. No, it will affect not just the Windows Explorer but any file manager or any other code based on Shell API — be aware of it. Some file managers will have different commands added to the Context Menu, like "Move" in one step. There are many other ways to manipulate file, using the console, first of all. See also the notes by Nishant he posted in his Solution.

That said, if you think your Context Menu can provide some kind of file protection, think again: it won''t, whatever you do with the Shell.

Finally, I''m not sure you really need to do this work (unless you want to register really serious application to work via Shell interface; a very successful example is such approach is TortoiseSVN, http://en.wikipedia.org/wiki/TortoiseSVN[^]).

If a Word document is opened, it cannot be deleted/moved anyway as Word keeps it open without shared access. If you simply use Word automation, it will always behave like that. In all other cases, you can do the same.

—SA


[添加到SA的响应中.]

仅在上下文菜单中禁用复制/剪切将不会阻止人们复制文件.他们可以使用键盘快捷键.他们可以使用控制台应用程序来执行此操作,也可以通过指定完整路径以编程方式来执行此操作.他们可以复制包含文档的父文件夹.实际上,通过跨网络映射驱动器,他们可以从另一台计算机跨网络完成驱动器.也请记住这一点.
[Adding to SA''s response.]

Merely disabling copy/cut in the context menus won''t help prevent people from copying the file. They can use keyboard shortcuts. They can use a console app to do it, or do it programatically by specifying the full path. They can copy a parent folder that contains the document. In fact by mapping the drive across a network, they can do it across the network from another machine. Keep this in mind too.


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

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