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)
or
2. Poll every few milliseconds and modify the system menu values of
the active window
For (1) I couldnt think of a way to do it. Is it even possible using
python?
For (2) I wrote the following code for basic testing:
hwnd = win32gui.GetFor egroundWindow()
hw = win32gui.GetSys temMenu(hwnd, False)
if hw != None:
win32gui.Append Menu(hw,win32co n.MF_SEPARATOR, 0,'-');
and it shows the following error: pywintypes.erro r: (1401,
'AppendMenu', 'Invalid menu handle.')
If anyone could help me out in both the options (1) and/or (2), I
would be very thankful.
Thank you very much in advance,
A python newbie
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)
or
2. Poll every few milliseconds and modify the system menu values of
the active window
For (1) I couldnt think of a way to do it. Is it even possible using
python?
For (2) I wrote the following code for basic testing:
hwnd = win32gui.GetFor egroundWindow()
hw = win32gui.GetSys temMenu(hwnd, False)
if hw != None:
win32gui.Append Menu(hw,win32co n.MF_SEPARATOR, 0,'-');
and it shows the following error: pywintypes.erro r: (1401,
'AppendMenu', 'Invalid menu handle.')
If anyone could help me out in both the options (1) and/or (2), I
would be very thankful.
Thank you very much in advance,
A python newbie
Comment