Antw: RE: [python-win32] Explorer like right mouse click context menue

Franz Steinhaeusler Franz.Steinhaeusler at amatic.com
Thu Jun 3 06:13:13 EDT 2004


>>> Tim Golden <tim.golden at viacom-outdoor.co.uk> 06/03 9:41 >>>
>| I want to enhance my little wxpython-filemanager with
>| a shell context menu.
>| 
>| Can anybody please advise, how and/or if it is possible
>| to add to a given File (Win XP) an explorer file context menue?

>Bit of a two-part response, really.

Hello Tim,

thank you for your response.

>First, it *is* possible, as of recent versions of pywin32, to
>add shell context menus. It's a bit messy, but there are some
>examples somewhere in the pywin32 distribution, although for
>the life of me I can't remember where.

I'm aware, that this wouldn't be an easy task.
I found some samples with google (but all in C or C++, and it seems
to be rather complicated).

Also I didn't find for example following function in pywin, which
are essential for building the shell context menu:
IContextMenu2 and IContextMenu3 ,...

Finally I found maybe something useful:
PyIContextMenu.QueryContextMenu in pywin32.chm
PyIContextMenu Object
but how to apply this (I saw no example code)?

>Secondly, I had a quick look at wxpyatol and it looks to me
>rather as though you just want to trap right-click events on
>your file windows. 

No, it's not the case.

>which is different from going to the lengths
>of telling the operating system to ask you code for extra menus
>whenever you right click on something in an explorer window.
>Have I misunderstood? 

In short: I want to have in my app the same context menu, as
I get, when i right-click a given file in explorer.

>Or are you really just asking: how do I
>manage right-click menus under a wxPython Frame?

No, this should not be the problem.

best regards and sorry for my english,

-- 
Franz Steinhäusler





More information about the Python-win32 mailing list