如何显示Windows资源管理器上下文(右键单击)菜单? [英] How to show Windows Explorer context (right click) menu?

查看:968
本文介绍了如何显示Windows资源管理器上下文(右键单击)菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示Windows资源管理器上下文菜单。

I want to show the Windows Explorer context menu.

我不想添加我的应用程序,我只想显示它。

I don't want to add my application to it, I just want to display it.

我需要的一个很好的例子是Total Commander。

A good example of the implementation that I need is Total Commander.

如果你按住鼠标右键,TC将显示上下文菜单,这与Windows资源管理器中的完全相同。

If you press and hold right mouse button, TC will show the context menu, which is exactly the same as in Windows explorer.

我使用C ++ / Qt,但语言在这里不重要。

I'm using C++/Qt, but language is not important here.

推荐答案

我发现了几个可能会帮助你的样本。你不可能单独使用Qt来做到这一点,因为shell上下文菜单高度特定于操作系统;可能还需要一些Win32调用。

I found several samples that may help you. You're not likely to be able to do this with Qt alone, since the shell context menu is highly OS-specific; probably some Win32 calls will be needed also.

  • Use Shell ContextMenu in your applications
  • Explorer Shell Context Menu

Raymond Chen博客系列如何托管IContextMenu a>

A Raymond Chen blog series "How to host an IContextMenu"

和一些非C ++范例也可以:

And some non-C++ samples also:

  • C# File Browser
  • Shell context menu sample in C#

和相关的SO问题:

  • How to access Windows shell context menu items?
  • How to obtain full shell context menu of right-click a folder background

这篇关于如何显示Windows资源管理器上下文(右键单击)菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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