简体   繁体   English

Windows资源管理器上下文菜单问题

[英]Windows Explorer Context Menu Question

I have a TreeView that represents some files/folders in the Windows file system. 我有一个TreeView,它代表Windows文件系统中的某些文件/文件夹。 i want to be able to right click one and display the standard Windows context menu. 我希望能够右键单击一个并显示标准的Windows上下文菜单。 The node's tag contains the file path. 节点的标签包含文件路径。 I have spent a fair amount of time researching and I found this: http://www.codeproject.com/KB/cs/shellContextMenu.aspx 我花了大量时间进行研究,发现了这一点: http : //www.codeproject.com/KB/cs/shellContextMenu.aspx

However, it seems to be missing the "Rename" item. 但是,它似乎缺少“重命名”项。 So I want to get that back.. 所以我想找回来。

I also want to know how to handle the functions. 我也想知道如何处理这些功能。 For example, if the user renames or deletes a file, I want to remove that node/rename that node accordingly. 例如,如果用户重命名或删除文件,我想删除该节点/相应地重命名该节点。

I am programming in C#, .NET 4. 我正在C#、. NET 4中编程。

您需要在IContextMenu.QueryContextMenu的uFlags参数中包括CMF_CANRENAME标志,以指示您的主机应用程序支持重命名项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM