You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pythonwin/pywin/Demos/menutest.py

13 lines
442 B

# Run this as a python script, to gray "close" off the edit window system menu.
from pywin.framework import interact
import win32con
if __name__=='__main__':
import demoutils
if demoutils.NeedGoodGUI():
win=interact.edit.currentView.GetParent()
menu=win.GetSystemMenu()
id=menu.GetMenuItemID(6)
menu.EnableMenuItem(id,win32con.MF_BYCOMMAND|win32con.MF_GRAYED)
print("The interactive window's 'Close' menu item is now disabled.")