Locating windows by their control ID - how to do it right

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Locating windows by their control ID - how to do it right

Heiko Folkerts-4
Hi all,
after succeeding in focussing a view that is activated I want to put the focus on it regardless where I am in the application. After digging arround in the archives I found out that one can get a window by calling findDescendantWindow and converting the handle into a NVDAObject. Using getNVDAObjectFromEvent results in the following error message:
DEBUGWARNING - RPC process 7656 (pdshell16.exe) (14:59:54):
Thread 4928, build\x86\remote\sysListView32.cpp, nvdaInProcUtils_sysListView32_getGroupInfo, 28:

Below I will put the code I am using - any help in making it better or right would be appreciated. I am still quite new to this and I think I am taking every pit fall available. So sorry for that simple questions.

def script_focusToBrowse(self, gesture):
                        NVDAObjects.IAccessible.getNVDAObjectFromEvent(windowUtils.findDescendantWindow(api.getForegroundObject().windowHandle,True,1),winUser.OBJID_CLIENT, 0).setFocusj()
                except LookupError:
                        ui.message("Browser is not active.")

thanks in advance


Mit freundlichen Grüßen

Dipl. Inf. (FH)
Heiko Folkerts
Systementwicklung und -Design


msg DAVID GmbH · Wendenring 1 · 38114 Braunschweig

Tel.: +49 531 24379-14
Fax.: +49 531 24379-79

E-Mail: mailto:[hidden email]
WWW:    https://www.msg-david.de

Eintragung: Amtsgericht Braunschweig, HRB 3167
Geschäftsführer: Frank Ptok, Andreas Lehmann


Nvda-devel mailing list
[hidden email]