Module oleacc
[hide private]
[frames] | no frames]

Module oleacc

source code

Functions [hide private]
int
LresultFromObject(wParam, obj)
returns a reference, similar to a handle, to the specified object.
source code
COMObject
ObjectFromLresult(res, wParam, interface)
retrieves a requested interface pointer for an accessible object based on a previously generated object reference.
source code
COMObject
CreateStdAccessibleProxy(hwnd, className, objectID, interface=IAccessible)
creates an accessible object using a specific window class, with the methods and properties of the specified type of system-provided user interface element.
source code
COMObject
CreateStdAccessibleObject(hwnd, objectID, interface=IAccessible)
creates an accessible object with the methods and properties of the specified type of system-provided user interface element.
source code
COMObject
AccessibleObjectFromWindow(hwnd, objectID, interface=IAccessible)
Retreaves a COM object from the given window, with the given object ID.
source code
 
AccessibleObjectFromWindow_safe(hwnd, objectID, interface=IAccessible, timeout=2) source code
COMObject
AccessibleObjectFromEvent(hwnd, objectID, childID)
Retreaves an IAccessible object from the given window, with the given object ID and child ID.
source code
 
AccessibleObjectFromEvent_safe(hwnd, objectID, childID, timeout=2) source code
int
WindowFromAccessibleObject(pacc)
Retreaves the handle of the window this IAccessible object belongs to.
source code
 
AccessibleObjectFromPoint(x, y) source code
 
AccessibleChildren(pacc, iChildStart, cChildren) source code
integer
GetProcessHandleFromHwnd(windowHandle)
Retreaves a process handle of the process who owns the window.
source code
 
GetRoleText(role) source code
 
GetStateText(state) source code
Variables [hide private]
  m = comtypes.client.GetModule('oleacc.dll')
  NAVDIR_MIN = 0
  NAVDIR_UP = 1
  NAVDIR_DOWN = 2
  NAVDIR_LEFT = 3
  NAVDIR_RIGHT = 4
  NAVDIR_NEXT = 5
  NAVDIR_PREVIOUS = 6
  NAVDIR_FIRSTCHILD = 7
  NAVDIR_LASTCHILD = 8
  NAVDIR_MAX = 9
  ROLE_SYSTEM_TITLEBAR = 1
  ROLE_SYSTEM_MENUBAR = 2
  ROLE_SYSTEM_SCROLLBAR = 3
  ROLE_SYSTEM_GRIP = 4
  ROLE_SYSTEM_SOUND = 5
  ROLE_SYSTEM_CURSOR = 6
  ROLE_SYSTEM_CARET = 7
  ROLE_SYSTEM_ALERT = 8
  ROLE_SYSTEM_WINDOW = 9
  ROLE_SYSTEM_CLIENT = 10
  ROLE_SYSTEM_MENUPOPUP = 11
  ROLE_SYSTEM_MENUITEM = 12
  ROLE_SYSTEM_TOOLTIP = 13
  ROLE_SYSTEM_APPLICATION = 14
  ROLE_SYSTEM_DOCUMENT = 15
  ROLE_SYSTEM_PANE = 16
  ROLE_SYSTEM_CHART = 17
  ROLE_SYSTEM_DIALOG = 18
  ROLE_SYSTEM_BORDER = 19
  ROLE_SYSTEM_GROUPING = 20
  ROLE_SYSTEM_SEPARATOR = 21
  ROLE_SYSTEM_TOOLBAR = 22
  ROLE_SYSTEM_STATUSBAR = 23
  ROLE_SYSTEM_TABLE = 24
  ROLE_SYSTEM_COLUMNHEADER = 25
  ROLE_SYSTEM_ROWHEADER = 26
  ROLE_SYSTEM_COLUMN = 27
  ROLE_SYSTEM_ROW = 28
  ROLE_SYSTEM_CELL = 29
  ROLE_SYSTEM_LINK = 30
  ROLE_SYSTEM_HELPBALLOON = 31
  ROLE_SYSTEM_CHARACTER = 32
  ROLE_SYSTEM_LIST = 33
  ROLE_SYSTEM_LISTITEM = 34
  ROLE_SYSTEM_OUTLINE = 35
  ROLE_SYSTEM_OUTLINEITEM = 36
  ROLE_SYSTEM_PAGETAB = 37
  ROLE_SYSTEM_PROPERTYPAGE = 38
  ROLE_SYSTEM_INDICATOR = 39
  ROLE_SYSTEM_GRAPHIC = 40
  ROLE_SYSTEM_STATICTEXT = 41
  ROLE_SYSTEM_TEXT = 42
  ROLE_SYSTEM_PUSHBUTTON = 43
  ROLE_SYSTEM_CHECKBUTTON = 44
  ROLE_SYSTEM_RADIOBUTTON = 45
  ROLE_SYSTEM_COMBOBOX = 46
  ROLE_SYSTEM_DROPLIST = 47
  ROLE_SYSTEM_PROGRESSBAR = 48
  ROLE_SYSTEM_DIAL = 49
  ROLE_SYSTEM_HOTKEYFIELD = 50
  ROLE_SYSTEM_SLIDER = 51
  ROLE_SYSTEM_SPINBUTTON = 52
  ROLE_SYSTEM_DIAGRAM = 53
  ROLE_SYSTEM_ANIMATION = 54
  ROLE_SYSTEM_EQUATION = 55
  ROLE_SYSTEM_BUTTONDROPDOWN = 56
  ROLE_SYSTEM_BUTTONMENU = 57
  ROLE_SYSTEM_BUTTONDROPDOWNGRID = 58
  ROLE_SYSTEM_WHITESPACE = 59
  ROLE_SYSTEM_PAGETABLIST = 60
  ROLE_SYSTEM_CLOCK = 61
  ROLE_SYSTEM_SPLITBUTTON = 62
  ROLE_SYSTEM_IPADDRESS = 63
  ROLE_SYSTEM_OUTLINEBUTTON = 64
  STATE_SYSTEM_NORMAL = 0
  STATE_SYSTEM_UNAVAILABLE = 0x1
  STATE_SYSTEM_SELECTED = 0x2
  STATE_SYSTEM_FOCUSED = 0x4
  STATE_SYSTEM_PRESSED = 0x8
  STATE_SYSTEM_CHECKED = 0x10
  STATE_SYSTEM_MIXED = 0x20
  STATE_SYSTEM_INDETERMINATE = 0x20
  STATE_SYSTEM_READONLY = 0x40
  STATE_SYSTEM_HOTTRACKED = 0x80
  STATE_SYSTEM_DEFAULT = 0x100
  STATE_SYSTEM_EXPANDED = 0x200
  STATE_SYSTEM_COLLAPSED = 0x400
  STATE_SYSTEM_BUSY = 0x800
  STATE_SYSTEM_FLOATING = 0x1000
  STATE_SYSTEM_MARQUEED = 0x2000
  STATE_SYSTEM_ANIMATED = 0x4000
  STATE_SYSTEM_INVISIBLE = 0x8000
  STATE_SYSTEM_OFFSCREEN = 0x10000
  STATE_SYSTEM_SIZEABLE = 0x20000
  STATE_SYSTEM_MOVEABLE = 0x40000
  STATE_SYSTEM_SELFVOICING = 0x80000
  STATE_SYSTEM_FOCUSABLE = 0x100000
  STATE_SYSTEM_SELECTABLE = 0x200000
  STATE_SYSTEM_LINKED = 0x400000
  STATE_SYSTEM_TRAVERSED = 0x800000
  STATE_SYSTEM_MULTISELECTABLE = 0x1000000
  STATE_SYSTEM_EXTSELECTABLE = 0x2000000
  STATE_SYSTEM_ALERT_LOW = 0x4000000
  STATE_SYSTEM_ALERT_MEDIUM = 0x8000000
  STATE_SYSTEM_ALERT_HIGH = 0x10000000
  STATE_SYSTEM_PROTECTED = 0x20000000
  STATE_SYSTEM_HASPOPUP = 0x40000000
  STATE_SYSTEM_VALID = 0x7fffffff
  SELFLAG_NONE = 0
  SELFLAG_TAKEFOCUS = 1
  SELFLAG_TAKESELECTION = 2
  SELFLAG_EXTENDSELECTION = 4
  SELFLAG_ADDSELECTION = 8
  SELFLAG_REMOVESELECTION = 16
  SELFLAG_VALID = 32
Function Details [hide private]

LresultFromObject(wParam, obj)

source code 

returns a reference, similar to a handle, to the specified object. Servers return this reference when handling WM_GETOBJECT.

Parameters:
  • wParam (int) - the wParam value passed in with WM_GETOBJECT.
  • obj (COMObject) - the COM object instance you want a reference for.
Returns: int
a reference to the object.

ObjectFromLresult(res, wParam, interface)

source code 

retrieves a requested interface pointer for an accessible object based on a previously generated object reference.

Parameters:
  • res (int) - the previously generated object reference.
  • wParam (int) - the wParam value passed in with WM_GETOBJECT.
  • interface (comtypes COM interface) - the requested COM interface.
Returns: COMObject
the object.

CreateStdAccessibleProxy(hwnd, className, objectID, interface=IAccessible)

source code 

creates an accessible object using a specific window class, with the methods and properties of the specified type of system-provided user interface element.

Parameters:
  • hwnd (int) - the handle of the window this accessible object should represent.
  • className (basestring) - the window class name to use.
  • objectID (int) - an OBJID_* constant or custom value stating the specific object in the window.
  • interface (comtypes COM interface) - the requested COM interface for this object. Defaults to IAccessible.
Returns: COMObject
the created object.

CreateStdAccessibleObject(hwnd, objectID, interface=IAccessible)

source code 

creates an accessible object with the methods and properties of the specified type of system-provided user interface element.

Parameters:
  • hwnd (int) - the handle of the window this accessible object should represent.
  • objectID (int) - an OBJID_* constant or custom value stating the specific object in the window.
  • interface (comtypes COM interface) - the requested COM interface for this object. Defaults to IAccessible.
Returns: COMObject
the created object.

AccessibleObjectFromWindow(hwnd, objectID, interface=IAccessible)

source code 

Retreaves a COM object from the given window, with the given object ID.

Parameters:
  • hwnd (int) - the handle of the window to retreave the object from.
  • objectID (int) - one of the OBJID_* constants or a custom positive value representing the specific object you want to retreave.
  • interface (comtypes COM interface) - the requested COM interface you wish to use on the retreaved object.
Returns: COMObject
the retreaved object.

AccessibleObjectFromEvent(hwnd, objectID, childID)

source code 

Retreaves an IAccessible object from the given window, with the given object ID and child ID.

Parameters:
  • hwnd (int) - the handle of the window to retreave the object from.
  • objectID (int) - one of the OBJID_* constants or a custom positive value representing the specific object you want to retreave.
  • childID (int) - the ID of the child element you wish to retreave.
Returns: COMObject
the retreaved object.

WindowFromAccessibleObject(pacc)

source code 

Retreaves the handle of the window this IAccessible object belongs to.

Parameters:
  • pacc (POINTER(IAccessible)) - the IAccessible object who's window you want to fetch.
Returns: int
the window handle.

GetProcessHandleFromHwnd(windowHandle)

source code 

Retreaves a process handle of the process who owns the window. If Windows Vista, uses GetProcessHandleFromHwnd found in oleacc.dll which allows a client with UIAccess to open a process who is elevated. if older than Windows Vista, just uses OpenProcess from user32.dll instead.

Parameters:
  • windowHandle (integer) - a window of a process you wish to retreave a process handle for
Returns: integer
a process handle with read, write and operation access