Windows Explorer context menu in java

Consider a simple application that displays a list of files. I would like to display a context menu when a user clicks a file or folder, just as when I right-click in Windows Explorer (open, rename, edit, etc.). I do not want to create my own context menu, I want to show the windows os context menu, possibly using some kind of winapi. This should only work on a Windows machine.

Is it possible to achieve this using Swing or SWT or any other user interface controls?

+4
source share
1 answer

This MSDN article explains how to do this:

Windows Explorer calls the object of the IShellFolder::GetUIObjectOf to request an interface for one of the objects .... When the user right-clicks the object, Windows Explorer requests the IContextMenu interface.

In C, here is a complete source code example.

0
source

All Articles