<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:raj.indian.08@gmail.com">raj.indian.08@gmail.com</a>></span><br>
Date: Tue, Sep 16, 2008 at 8:31 PM<br>Subject: Modifying the system menu<br>To: <a href="mailto:python-list@python.org">python-list@python.org</a><br><br><br>Hi all,<br>
I am trying to modify the system menu of all the applications in<br>
my machine.<br>
For example say - I am creating multiple desktops for windows -<br>
and I want to give every application the capability to be moved across<br>
different desktops. So I wanted to modify the basic system menu list<br>
to include the new options.<br>
<br>
The methods I could think of are -<br>
1. Modify the basic windows set of system menu values (best option)<br>
or<br>
2. Poll every few milliseconds and modify the system menu values of<br>
the active window<br>
<br>
For (1) I couldnt think of a way to do it. Is it even possible using<br>
python?<br>
<br>
For (2) I wrote the following code for basic testing:<br>
hwnd = win32gui.GetForegroundWindow()<br>
hw = win32gui.GetSystemMenu(hwnd, False)<br>
if hw != None:<br>
win32gui.AppendMenu(hw,win32con.MF_SEPARATOR,0,'-');<br>
<br>
and it shows the following error: pywintypes.error: (1401,<br>
'AppendMenu', 'Invalid menu handle.')<br>
<br>
If anyone could help me out in both the options (1) and/or (2), I<br>
would be very thankful.<br>
<br>
Thank you very much in advance,<br>
A python newbie<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></div><br><br clear="all"><br>-- <br><a href="http://www.goldwatches.com/">http://www.goldwatches.com/</a><br>
</div>