[python-win32] Fwd: Modifying the system menu

Tim Roberts timr at probo.com
Wed Sep 17 20:07:34 CEST 2008


James Matthews wrote:
>
> Hi all,
>    I am trying to modify the system menu of all the applications in
> my machine.
>    For example say - I am creating multiple desktops for windows  -
> and I want to give every application the capability to be moved across
> different desktops. So I wanted to modify the basic system menu list
> to include the new options.
>
>    The methods I could think of are -
> 1. Modify the basic windows set of system menu values (best option)

There is no central repository where this is stored, so there's no place
to change.


> 2. Poll every few milliseconds and modify the system menu values of
> the active window

Ick  Windows don't come and go that often, and you only need to do this
once for each application.

The correct option is (3) install a Windows hook to watch for new
application to activate, and modify the menu in the hook.  You will have
to use a hook in order to catch the menu item being chosen anyway. 
There are Python modules to handle some kinds of hooks, but overall this
would be much easier in C.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list