jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Helpful script writing tricks and HowTo's
User avatar
jeeswg
Posts: 4119
Joined: 19 Dec 2016, 01:58
Location: UK

jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

28 Nov 2017, 03:54

==================================================

Microsoft Active Accessibility (MSAA) (Acc)

GET WINDOW INFO:
- I use AccViewer as a window spy, to get information about windows/controls/GUI elements.
- One thing that AccViewer doesn't currently show is the GUI element state, see AccViewer Basic which does.
- Any information that can be retrieved via AccViewer, can be retrieved using the Acc functions (Acc library).
- The AccViewer Basic script demonstrates how to use the Acc functions.

SET WINDOW INFO/INTERACT WITH WINDOW:
- Acc provides an accDoDefaultAction method, where available, this is usually equivalent to double-clicking on a GUI element/control.
- The accSelect method can be used to change the focus/selection.
- For *some* but not all GUI elements, you can set the value by specifying the text via accValue.

==================================================

SCRIPTS / FUNCTIONS

Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201

[examples of how to get information from a window via Acc]
AccViewer Basic - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=32039

[JEE_AccGetTextAll: a function to get text and ID information for all the GUI elements in a window/control]
GUIs via DllCall: get/set internal/external control text - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40514
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615

==================================================

REFERENCE LISTS

[list of methods]
IAccessible interface (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318466(v=vs.85).aspx

[role constants (describe the type of a GUI element)]
AccViewer Basic - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=32039&p=167451#p167451

[state constants (describe the state of a GUI element)]
AccViewer Basic - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=32039&p=177601#p177601

[selection constants for use with accSelect]
SELFLAG Constants (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/dd373634(v=vs.85).aspx

==================================================

FURTHER LINKS AND EXAMPLE SCRIPTS

[introductions]
Microsoft Active Accessibility - Wikipedia
https://en.wikipedia.org/wiki/Microsoft_Active_Accessibility
Microsoft Active Accessibility (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/dd373592(v=vs.85).aspx

Threads where I use Acc_Get:
- Get text from status bar - AutoHotkey Community
- Unable to detect Checkbox control using Windows Spy - AutoHotkey Community
- GUI COMMANDS: COMPLETE RETHINK - AutoHotkey Community
- Hotkey to sort images by Rating/Descending - AutoHotkey Community
- Internet Explorer Save Open Cancel Popup - AutoHotkey Community
- set text/state of listbox/listview items via Acc? - AutoHotkey Community
- AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC) - AutoHotkey Community
- is it possible to write a script that opens specific chrome or firefox tabs - AutoHotkey Community
- Windows Update: detect if important updates available - AutoHotkey Community
- Move mouse to taskbar to use AeroPeek - AutoHotkey Community
- Acc (MSAA) - Text Without Needing Cursor Position? - AutoHotkey Community
- WinGetText and ControlGetText not working on certain windows - AutoHotkey Community
- ResetArray() , ExtractURLDomain(), GetChromeURL() - AutoHotkey Community
- Resizing the preview pane of Windows Explorer - AutoHotkey Community
- IE Com Save Dialog - Auto Save using ACC - AutoHotkey Community
- ungettable text (Character Map/Excel/WordPad) - AutoHotkey Community
- Can I detect mouse over window title? - AutoHotkey Community
- Chrome update, now winkill not working - AutoHotkey Community
- Select text from prompt and select the proper option - AutoHotkey Community
- Getting position and size of the scroll bar - AutoHotkey Community
- Close a Window - How - AutoHotkey Community
- To Scroll the Bar with Arrow Keys - AutoHotkey Community
- Detect if classNN is scrollable - AutoHotkey Community
- Selecting a tab in another program - AutoHotkey Community
- Grabbing scrollbar control or location - AutoHotkey Community
- Windows Explorer folder positions and scrolling - AutoHotkey Community
- Add "https://" in URL if specific error page is displayed on Google Chrome - AutoHotkey Community
- Internet Explorer: activate tab - AutoHotkey Community
- ACC.AHK - Get IAccessible for Context menu - AutoHotkey Community
- Script idea for an expert: typing in list view - AutoHotkey Community
- script to full screen YouTube videos - AutoHotkey Community
- Is it possible to get coordinates of selected item in TreeView (TreeViewWndClass1) control ? - AutoHotkey Community
- How to click on the control position? - AutoHotkey Community
- set value to Acc object children? - AutoHotkey Community
- Check if a box is checked in an other program - AutoHotkey Community
- Using COM to manipulate Microsoft Word's Navigation task pane - AutoHotkey Community
- ControlClick to click on X of window - AutoHotkey Community
- ControlSend command to send the problem - AutoHotkey Community
- active accessibility get value - AutoHotkey Community
- active accessibility click selectable - AutoHotkey Community
- Shortage for few auto excel operations ? - AutoHotkey Community
- Pin to taskbar in Windows 10 - AutoHotkey Community
- Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
- notepad get/set path (get/set text file path) - AutoHotkey Community
- AccViewer Basic - AutoHotkey Community
- Explorer column interaction (get/set: which appear, width, ascending/descending order) - AutoHotkey Community
- Explorer window interaction (folder windows/Desktop, file/folder enumeration/selection/navigation/creation) - AutoHotkey Community
- GUIs via DllCall: get/set internal/external control text - AutoHotkey Community
- jeeswg's Notepad tutorial - AutoHotkey Community
- Hotkey Control Partially Works - AutoHotkey Community
- Acc / AccViewer / iWB2 Learner / Anchor conversion attempts - AutoHotkey Community
Last edited by jeeswg on 14 Apr 2018, 10:35, edited 8 times in total.
User avatar
jeeswg
Posts: 4119
Joined: 19 Dec 2016, 01:58
Location: UK

Re: jeeswg's Acc tutorial (initial content)

28 Nov 2017, 04:19

[RESERVED]

Return to “Tutorials”

Who is online

Users browsing this forum: Scribble and 3 guests