codekingpro/portable-devtools
114k
1# Run this as a python script, to gray "close" off the edit window system menu.2import win32con3from pywin.framework import interact4 5if __name__ == "__main__":6 import demoutils7 8 if demoutils.NeedGoodGUI():9 win = interact.edit.currentView.GetParent()10 menu = win.GetSystemMenu()11 id = menu.GetMenuItemID(6)12 menu.EnableMenuItem(id, win32con.MF_BYCOMMAND | win32con.MF_GRAYED)13 print("The interactive window's 'Close' menu item is now disabled.")14 