[英]windows explorer context menu in java
Consider simple application, that display list of file. 考虑简单的应用程序,即显示文件列表。 I would like to display context menu , when user click of file or folder, the same as, when user right mouse click in windows explorer (open, rename, edit etc.).
我想显示上下文菜单,当用户点击文件或文件夹时,用户在Windows资源管理器中单击鼠标右键(打开,重命名,编辑等)。 I don't want to create my own context menu, I want to show windows os context menu, using some kind of winapi probably.
我不想创建自己的上下文菜单,我想显示windows os上下文菜单,可能使用某种winapi。 This should works only on windows machine.
这应该只适用于Windows机器。
Is it possible to achieve it with Swing or SWT or any other UI controls ? 是否可以使用Swing或SWT或任何其他UI控件实现它?
This MSDN article explains how it is done: 这篇MSDN 文章解释了它是如何完成的:
Windows Explorer calls a folder object's
IShellFolder::GetUIObjectOf
to request an interface for one of the objects.... When a user right-clicks an object, Windows Explorer requests anIContextMenu
interface.Windows资源管理器调用文件夹对象的
IShellFolder::GetUIObjectOf
来请求其中一个对象的接口....当用户右键单击某个对象时,Windows资源管理器会请求IContextMenu
接口。
There is a full source code example in C here . 有在C完整的源代码示例在这里 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.