如何更改资源管理器上下文菜单和传递命令以进行编程? [英] How to change Explorer Context Menu and Pass command to program?

查看:61
本文介绍了如何更改资源管理器上下文菜单和传递命令以进行编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我想做的是添加一个上下文菜单,以便当用户右键单击任何Windows文件夹时,他们应该看到监视此文件夹",如果他们选择此菜单项,则应将文件夹名称添加到程序中被监视,但是如果他们右键单击正在监视的文件夹,我需要它阅读停止监视此文件夹",并将其从程序中删除.

因此,当用户右键单击未监视的文件夹时,它会显示监视此文件夹",用户选择此选项,传递文件夹名称,并告诉程序运行功能"watchThisFolder".或者,如果用户右键单击正在监视的文件夹,他们将看到一个菜单项停止监视此文件夹",则用户选择此选项时它将传递文件夹名称并告诉程序运行功能"stopWatching".


So what I want to do is add a context menu so that when a user right clicks on any windows folder they should see "Watch this Folder", if they choose this menu item it should add the folders name to the program to be watched, but if they right click on a folder that is being watched I need it to read "Stop Watching this folder" and that remove the folder from the program.

So when the user right clicks on an unwatched folder it says "Watch this folder", User selects this option, passes the folder name and tells the program to run the function "watchThisFolder". Or if the user right clicks on a folder that is being watched they see a menu item that says "Stop Watching This folder", User selects this option it passes the folder name and tells the program to run the function "stopWatching".


Any body able to help me or atleast point me in the right direction?

推荐答案

听起来像您真正想要做的事情是创建shell扩展.迈克尔·邓恩(Michael Dunn)写了一系列文章,描述了您如何做到这一点. 编写外壳扩展的完整白痴指南-索引 [ ^ ]
Sounds like what you really want to do is create a shell extension. Michael Dunn wrote a whole series of articles describing how you do that. The Complete Idiot''s Guide to Writing Shell Extensions - Index[^]


这篇关于如何更改资源管理器上下文菜单和传递命令以进行编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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