鼠标右键添加【电脑重启】

新建记事本文件,复制以下代码,保存成.reg文件,双击运行添加注册表。

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell\电脑重启]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell\电脑重启\command]
@="Shutdown.exe -r -t 00"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 VSTO 中添加鼠标右键菜单,可以通过以下步骤实现: 1. 在 Visual Studio 中创建一个新的 VSTO 项目。 2. 在解决方案资源管理器中,右键单击项目,并选择“添加”->“新项”。 3. 在“添加新项”对话框中,选择“Office 项目”->“Outlook 项”,并选择“自定义 Outlook 邮件项”。 4. 在“自定义 Outlook 邮件项”对话框中,选择“邮件”并点击“下一步”。 5. 在“选择项类型”页面中,选择“邮件窗体”,并点击“下一步”。 6. 在“命名项”页面中,为新项命名并点击“完成”。 7. 打开该项的代码视图,在 ThisAddIn.cs 文件中,添加以下代码: ``` private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.ItemContextMenuDisplay += new Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay); } void Application_ItemContextMenuDisplay(CommandBar CommandBar, Selection Selection) { if (Selection.Count == 1 && Selection[1] is Outlook.MailItem) { CommandBarPopup popup = (CommandBarPopup)CommandBar.Controls.Add(MsoControlType.msoControlPopup, missing, missing, missing, true); popup.Caption = "My Custom Menu"; CommandBarButton button = (CommandBarButton)popup.Controls.Add(MsoControlType.msoControlButton, missing, missing, missing, true); button.Caption = "My Custom Command"; button.Click += new _CommandBarButtonEvents_ClickEventHandler(button_Click); } } void button_Click(CommandBarButton Ctrl, ref bool CancelDefault) { MessageBox.Show("My Custom Command was clicked"); } ``` 上述代码中,我们通过 ThisAddIn_Startup 事件处理程序,订阅了 Application.ItemContextMenuDisplay 事件。在 Application_ItemContextMenuDisplay 事件处理程序中,我们检查当前选择是否为邮件,并创建一个自定义弹出菜单和一个自定义命令按钮。当用户单击自定义命令按钮时,会触发 button_Click 事件处理程序,弹出一个消息框。 现在,您可以运行该项目,打开 Outlook 并尝试右键单击邮件,您将看到自定义的菜单和命令按钮。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值