thread.py 526 B

12345678910111213141516171819202122
  1. # Thread and application objects
  2. from . import object
  3. import win32ui
  4. class WinThread(object.CmdTarget):
  5. def __init__(self, initObj = None):
  6. if initObj is None:
  7. initObj = win32ui.CreateThread()
  8. object.CmdTarget.__init__(self, initObj)
  9. def InitInstance(self):
  10. pass # Default None/0 return indicates success for InitInstance()
  11. def ExitInstance(self):
  12. pass
  13. class WinApp(WinThread):
  14. def __init__(self, initApp = None):
  15. if initApp is None:
  16. initApp = win32ui.GetApp()
  17. WinThread.__init__(self, initApp)