简体   繁体   中英

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.). I don't want to create my own context menu, I want to show windows os context menu, using some kind of winapi probably. This should works only on windows machine.

Is it possible to achieve it with Swing or SWT or any other UI controls ?

This MSDN article explains how it is done:

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.

There is a full source code example in C here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM