Modifying the system menu

raj.indian.08 at raj.indian.08 at
Thu Sep 18 17:14:03 CEST 2008

On Sep 18, 6:39 am, raj.indian... at wrote:
> 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 worryingly, this happens randomly. Am I doing some mistake here?

More information about the Python-list mailing list