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
示例#2
0
	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)
示例#3
0
文件: __init__.py 项目: vgjh2005/nvda
	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)
示例#4
0
	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)
示例#5
0
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
示例#6
0
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
示例#8
0
	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)
示例#9
0
	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)
示例#10
0
	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)
示例#11
0
文件: __init__.py 项目: vgjh2005/nvda
	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)
示例#12
0
文件: __init__.py 项目: vgjh2005/nvda
	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)
示例#13
0
文件: __init__.py 项目: vgjh2005/nvda
	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)
示例#14
0
	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)
示例#15
0
	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)