Reputation: 3401
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 ?
Upvotes: 6
Views: 1941
Reputation: 5638
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 anIContextMenu
interface.
There is a full source code example in C here.
Upvotes: 1