Create Explorer.exe's File - Context Menu in WxPython application
I have a WxPython app that, among other things, has a integrated file-browser.
I want to be able to create a system-default file context menu (e.g. what you get if you right-click on a file in windows explorer) when a user right clicks on one of the items within my application.
Note: I already know how to create my own context menu (e.g. wx.EVT_LIST_ITEM_RIGHT_CLICK), I want the Windows context menu.
To clarify, I do not want, or need to modify the existing system context menu, I want to be able to display it for a specific file within my application.
Basically, I know what was right clicked on, and where the mouse pointer is (if it's needed). I want to create the 开发者_开发技巧system context menu there, just like it works in windows explorer.
If you have python win32 installed, then look under the directory <PYTHON>/lib/site-packages/win32comext/shell/demos/servers
. This contains a file context_menu.py
which has sample code for creating a shell extension.
Update: I think you want the folder_view.py
sample.
精彩评论