window.py 500 B

12345678910111213
  1. # Framework Window classes.
  2. # Most Pythonwin windows should use these classes rather than
  3. # the raw MFC ones if they want Pythonwin specific functionality.
  4. import pywin.mfc.window
  5. import win32con
  6. class MDIChildWnd(pywin.mfc.window.MDIChildWnd):
  7. def AutoRestore(self):
  8. "If the window is minimised or maximised, restore it."
  9. p = self.GetWindowPlacement()
  10. if p[1]==win32con.SW_MINIMIZE or p[1]==win32con.SW_SHOWMINIMIZED:
  11. self.SetWindowPlacement(p[0], win32con.SW_RESTORE, p[2], p[3], p[4])