本文整理汇总了Python中win32gui.PostQuitMessage方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.PostQuitMessage方法的具体用法?Python win32gui.PostQuitMessage怎么用?Python win32gui.PostQuitMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32gui
的用法示例。
在下文中一共展示了win32gui.PostQuitMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
print "tearing down ExplorerBrowser..."
self.eb.Unadvise(self.event_cookie)
self.eb.Destroy()
self.eb = None
print "shutting down app..."
win32gui.PostQuitMessage(0)
示例2: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
win32gui.PostQuitMessage(0) # Terminate the app.
# An implementation suitable for use with the Win32 Dialog functions.
示例3: DemoCreateWindow
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def DemoCreateWindow():
w=DemoWindow()
w.CreateWindow()
# PumpMessages runs until PostQuitMessage() is called by someone.
win32gui.PumpMessages()
示例4: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
nid = (self.hwnd, 0)
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid)
win32gui.PostQuitMessage(0) # Terminate the app.
示例5: destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def destroy(self, hwnd, msg, wparam, lparam):
if self.on_quit: self.on_quit(self)
nid = (self.hwnd, 0)
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid)
win32gui.PostQuitMessage(0) # Terminate the app.
示例6: enumCallback
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def enumCallback(hwnd, windowName):
"""
Will get called by win32gui.EnumWindows, once for each
top level application window.
"""
try:
# Get window title
title = win32gui.GetWindowText(hwnd)
# Is this our guy?
if title.find(windowName) == -1:
return
(threadId, processId) = win32process.GetWindowThreadProcessId(hwnd)
# Send WM_CLOSE message
try:
win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
win32gui.PostQuitMessage(hwnd)
except:
pass
# Give it upto 5 sec
for i in range(100):
if win32process.GetExitCodeProcess(processId) != win32con.STILL_ACTIVE:
# Process exited already
return
time.sleep(0.25)
try:
# Kill application
win32process.TerminateProcess(processId, 0)
except:
pass
except:
pass
示例7: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
nid = (self.hwnd, 0)
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid)
win32gui.PostQuitMessage(0)
self.logger.info('Window destroyed.')
示例8: _destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def _destroy(klass, hwnd, msg, wparam, lparam):
del klass._instance[hwnd]
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, (hwnd, 0))
win32gui.PostQuitMessage(0)
return
示例9: destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def destroy(self, hwnd, msg, wparam, lparam):
if self.on_quit:
self.on_quit(self)
nid = (self.hwnd, 0)
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid)
win32gui.PostQuitMessage(0) # Terminate the app.
示例10: _on_destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def _on_destroy(self, hwnd, msg, wparam, lparam):
win32gui.PostQuitMessage(0)
示例11: _on_close
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def _on_close(self, hwnd, msg, wparam, lparam):
win32gui.PostQuitMessage(0)
示例12: close
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def close(self):
win32gui.PostQuitMessage(0)
示例13: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
# print("OnDestroy")
# win32gui.PostQuitMessage(0)
win32gui.EndDialog(hwnd, 0)
self.hwnd = None
示例14: OnClose
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnClose(self, hwnd, msg, wparam, lparam):
print("OnClose")
# win32gui.EndDialog(hwnd, 0)
self.hide()
# win32gui.PostQuitMessage(0)
示例15: OnDestroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PostQuitMessage [as 别名]
def OnDestroy(self, hwnd, msg, wparam, lparam):
nid = (self.main_frame.hwnd, 0)
win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid)
win32gui.PostQuitMessage(0) # Terminate the app.