def OnDestroy(self, hwnd, msg, wparam, lparam): win32gui.PostQuitMessage(0) # Terminate the app. # An implementation suitable for use with the Win32 Dialog functions.