当前位置: 首页>>代码示例>>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;未经允许,请勿转载。