Modifying the system menu

raj.indian.08 at gmail.com raj.indian.08 at gmail.com
Wed Sep 17 21:39:05 EDT 2008


I tested it again and found that the behaviour is a little different
from what I mentioned previously in the mailchain.
The item is working perfectly the first time around. Now if I close
the application and run it again (which was what I did earlier), if
that application system menu is already modified, it is causing this
issue.

Why would this happen? If it is that the file handle is not obtained,
it wouldnt have gone through the following check at all?
>     hw = win32gui.GetSystemMenu(hwnd, False)
>     if hw != None:
>         win32gui.AppendMenu(hw,win32con.MF_SEPARATOR,0,'-');

Not only did it go through, it failed with an invalid menu handle
error.



More information about the Python-list mailing list