本文整理匯總了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.