def __init__(self, initobj=None): object.CmdTarget.__init__(self, initobj) if self._obj_: self._obj_.HookMessage(self.OnDestroy, win32con.WM_DESTROY)