简体   繁体   English

java中的Windows资源管理器上下文菜单

[英]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 an IContextMenu 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.

相关问题 如何使用 java swing 中的 windows 资源管理器上下文菜单打开.txt? - How to open .txt using windows explorer context menu in java swing? 如何为Java应用程序向Windows资源管理器添加上下文菜单? - How can I add a context menu to the Windows Explorer for a Java application? 将Windows资源管理器上下文菜单(右键菜单)的FilePath获取到Java - Get FilePath of Windows Explorer Context Menu (Right-click menu) to Java 从 Windows 上下文菜单运行 Java 应用程序 - Running a Java Application from the Windows Context Menu 如何在Java中的Windows资源管理器中获取文件右键菜单 - How to get the file right click menu in windows explorer in Java 如何仅在项目中的.java文件中在项目资源管理器上下文菜单中添加弹出菜单 - How can I add popup menu in Project explorer context menu, only for .java files in project 如何将上下文菜单项添加到Windows资源管理器中用于exe以外的文件夹 - How add context menu item to Windows Explorer for folders different than exe 包浏览器URI eclipse插件上下文菜单? - Package Explorer URI eclipse plugin context menu? 在java中打开Windows资源管理器 - Open up windows explorer in java Java在Windows资源管理器中选择文件? - Java Select File in windows Explorer?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM