當前位置: 首頁>>代碼示例>>Python>>正文


Python win32gui.PostQuitMessage方法代碼示例

本文整理匯總了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) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:9,代碼來源:explorer_browser.py

示例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. 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:6,代碼來源:win32gui_dialog.py

示例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() 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:7,代碼來源:win32gui_dialog.py

示例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. 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:6,代碼來源:win32gui_taskbar.py

示例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. 
開發者ID:samclane,項目名稱:LIFX-Control-Panel,代碼行數:7,代碼來源:SysTrayIcon.py

示例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 
開發者ID:MozillaSecurity,項目名稱:peach,代碼行數:41,代碼來源:tcp.py

示例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.') 
開發者ID:Peter92,項目名稱:MouseTracks,代碼行數:7,代碼來源:tray.py

示例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 
開發者ID:euske,項目名稱:pyrexecd,代碼行數:7,代碼來源:__init__.py

示例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. 
開發者ID:OpenBazaar,項目名稱:OpenBazaar-Installer,代碼行數:8,代碼來源:systray.py

示例10: _on_destroy

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import PostQuitMessage [as 別名]
def _on_destroy(self, hwnd, msg, wparam, lparam):
        win32gui.PostQuitMessage(0) 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:4,代碼來源:window.py

示例11: _on_close

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import PostQuitMessage [as 別名]
def _on_close(self, hwnd, msg, wparam, lparam):
        win32gui.PostQuitMessage(0) 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:4,代碼來源:window.py

示例12: close

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import PostQuitMessage [as 別名]
def close(self):
        win32gui.PostQuitMessage(0) 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:4,代碼來源:window.py

示例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 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:7,代碼來源:console.py

示例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) 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:7,代碼來源:console.py

示例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. 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:6,代碼來源:shell.py


注:本文中的win32gui.PostQuitMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。