本文整理汇总了Python中win32gui.IsWindow方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.IsWindow方法的具体用法?Python win32gui.IsWindow怎么用?Python win32gui.IsWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32gui
的用法示例。
在下文中一共展示了win32gui.IsWindow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_all_hwnd
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
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)
示例2: onClose
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
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)
示例3: _enumWindows
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
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))
示例4: EnumWindows
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
def EnumWindows(self):
hWndList = [] # 枚举所有窗口,并把有效窗口handle保存在hwndlist里
def foo(hwnd, mouse):
if win32gui.IsWindow(hwnd):
hWndList.append(hwnd)
win32gui.EnumWindows(foo, 0)
return hWndList
示例5: ImprIsRunning
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
def ImprIsRunning(self, hwnd):
self.sched = eg.scheduler.AddTask(2, self.ImprIsRunning, hwnd)
if not IsWindow(hwnd):
self.StopPresentation()
示例6: StopPresentation
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import IsWindow [as 别名]
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