def getForegroundObject(): hdMain = ctypes.windll.user32.GetForegroundWindow() if not getString( vlc_strings.ID_VLCAppTitle) in winUser.getWindowText(hdMain): hdMain = winUser.getWindow(winUser.getWindow(hdMain, 2), 2) o = getNVDAObjectFromEvent(hdMain, -4, 0) return o
def _get_lastChild(self): childWindow=winUser.getTopWindow(self.windowHandle) nextWindow=winUser.getWindow(childWindow,winUser.GW_HWNDNEXT) while nextWindow: childWindow=nextWindow nextWindow=winUser.getWindow(childWindow,winUser.GW_HWNDNEXT) while childWindow and not isUsableWindow(childWindow): childWindow=winUser.getWindow(childWindow,winUser.GW_HWNDPREV) if childWindow: return Window(windowHandle=childWindow)
def _get_lastChild(self): childWindow=winUser.getTopWindow(self.windowHandle) nextWindow=winUser.getWindow(childWindow,winUser.GW_HWNDNEXT) while nextWindow: childWindow=nextWindow nextWindow=winUser.getWindow(childWindow,winUser.GW_HWNDNEXT) while childWindow and (not winUser.isWindowVisible(childWindow) or not winUser.isWindowEnabled(childWindow)): childWindow=winUser.getWindow(childWindow,winUser.GW_HWNDPREV) if childWindow: return Window(windowHandle=childWindow)
def findWindow(window): h = getWindow(getTopWindow(), firstChild) id = ctrlIdsDic[window] i = 70 while i: i = i - 1 if getControlID(h) == id: return h h = getWindow(h, nextWindow) return None
def findWindowNVDAObject(window): h = getWindow(getTopWindow(), firstChild) id = ctrlIdsDic[window] i = 70 while i: i = i - 1 if getControlID(h) == id: obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(h, -4, 0) return obj h = getWindow(h, nextWindow) return None
def isRealWindow(hWnd): lExStyle = getExtendedWindowStyle(hWnd) isToolWindow = (lExStyle & WS_EX_TOOLWINDOW) == 0 isAppWindow = (lExStyle & WS_EX_APPWINDOW) == 0 hasOwner = winUser.getWindow(hWnd, winUser.GW_OWNER) if not winUser.isWindowVisible(hWnd): return False if getParent(hWnd): return False if (isToolWindow and not hasOwner) or ((isAppWindow and hasOwner)): if winUser.getWindowText(hWnd): return True return False
def _get_firstChild(self): childWindow=winUser.getTopWindow(self.windowHandle) while childWindow and not isUsableWindow(childWindow): childWindow=winUser.getWindow(childWindow,winUser.GW_HWNDNEXT) if childWindow: return Window(windowHandle=childWindow)
def _get_previous(self): prevWindow=winUser.getWindow(self.windowHandle,winUser.GW_HWNDPREV) while prevWindow and not isUsableWindow(prevWindow): prevWindow=winUser.getWindow(prevWindow,winUser.GW_HWNDPREV) if prevWindow: return Window(windowHandle=prevWindow)
def _get_next(self): nextWindow=winUser.getWindow(self.windowHandle,winUser.GW_HWNDNEXT) while nextWindow and not isUsableWindow(nextWindow): nextWindow=winUser.getWindow(nextWindow,winUser.GW_HWNDNEXT) if nextWindow: return Window(windowHandle=nextWindow)
def _get_previous(self): prevWindow=winUser.getWindow(self.windowHandle,winUser.GW_HWNDPREV) while prevWindow and (not winUser.isWindowVisible(prevWindow) or not winUser.isWindowEnabled(prevWindow)): prevWindow=winUser.getWindow(prevWindow,winUser.GW_HWNDPREV) if prevWindow: return Window(windowHandle=prevWindow)
def _get_next(self): nextWindow=winUser.getWindow(self.windowHandle,winUser.GW_HWNDNEXT) while nextWindow and (not winUser.isWindowVisible(nextWindow) or not winUser.isWindowEnabled(nextWindow)): nextWindow=winUser.getWindow(nextWindow,winUser.GW_HWNDNEXT) if nextWindow: return Window(windowHandle=nextWindow)