Python win32gui.IsWindow() Examples

The following are 7 code examples of win32gui.IsWindow(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module win32gui , or try the search function .
Example #1
Source File: dual.py    From onmyoji_bot with GNU General Public License v3.0 6 votes vote down vote up
def get_all_hwnd(hwnd, mouse):
    '''
    获取所有阴阳师窗口
    '''
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
        if win32gui.GetWindowText(hwnd) == u'阴阳师-网易游戏':
            hwndlist.append(hwnd) 
Example #2
Source File: EmbedWindow.py    From PyQt with GNU General Public License v3.0 5 votes vote down vote up
def _enumWindows(self, hwnd, _):
        """遍历回调函数"""
        if hwnd == self.myhwnd:
            return  # 防止自己嵌入自己
        if win32gui.IsWindow(hwnd) and win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
            phwnd = win32gui.GetParent(hwnd)
            title = win32gui.GetWindowText(hwnd)
            name = win32gui.GetClassName(hwnd)
            self.windowList.addItem(
                '{0}|{1}|\t标题:{2}\t|\t类名:{3}'.format(hwnd, phwnd, title, name)) 
Example #3
Source File: WindowsUI.py    From Poco with Apache License 2.0 5 votes vote down vote up
def EnumWindows(self):
        hWndList = []  # 枚举所有窗口,并把有效窗口handle保存在hwndlist里

        def foo(hwnd, mouse):
            if win32gui.IsWindow(hwnd):
                hWndList.append(hwnd)
        win32gui.EnumWindows(foo, 0)
        return hWndList 
Example #4
Source File: explore_dual.py    From onmyoji_bot with GNU General Public License v3.0 5 votes vote down vote up
def get_all_hwnd(hwnd, mouse):
    '''
    获取所有阴阳师窗口
    '''
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
        if win32gui.GetWindowText(hwnd) == u'阴阳师-网易游戏':
            hwndlist.append(hwnd) 
Example #5
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def onClose(self, event):
        self.Show(False)
        self.Destroy()
        if self.plugin:
            self.plugin.menuDlg = None
        if self.gotowin and IsWindow(self.gotowin):
            PostMessage(self.gotowin, WM_CLOSE, 0, 0) 
Example #6
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def ImprIsRunning(self, hwnd):
        self.sched = eg.scheduler.AddTask(2, self.ImprIsRunning, hwnd)
        if not IsWindow(hwnd):
            self.StopPresentation() 
Example #7
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def StopPresentation(self):
        if hasattr(self, 'sched') and self.sched:
            eg.scheduler.CancelTask(self.sched)
        if hasattr(self.presentation, "end"):
            self.presentation.end()
        if hasattr(self, 'hWnd') and IsWindow(self.hWnd):
            PostMessage(self.hWnd, WM_CLOSE, 0, 0)
        self.controller = None
        self.presentation = None