@bun-win32/uiautomationcore 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AI.md ADDED
@@ -0,0 +1,74 @@
1
+ # AI Guide for @bun-win32/uiautomationcore
2
+
3
+ How to use this package, not what the Win32 API does.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import UIAutomationCore, { SomeFlag } from '@bun-win32/uiautomationcore';
9
+
10
+ // Methods bind lazily on first call
11
+ const result = UIAutomationCore.SomeFunction(arg1, arg2);
12
+
13
+ // Preload: array, single string, or no args (all symbols)
14
+ UIAutomationCore.Preload(['SomeFunction', 'AnotherFunction']);
15
+ UIAutomationCore.Preload('SomeFunction');
16
+ UIAutomationCore.Preload();
17
+ ```
18
+
19
+ ## Where To Look
20
+
21
+ | Need | Read |
22
+ | --------------------------------- | ---------------------------- |
23
+ | Find a method or its MS Docs link | `structs/UIAutomationCore.ts` |
24
+ | Find types, enums, constants | `types/UIAutomationCore.ts` |
25
+ | Quick examples | `README.md` |
26
+
27
+ `index.ts` re-exports the class and all types - import from `@bun-win32/uiautomationcore` directly.
28
+
29
+ ## Calling Convention
30
+
31
+ All documented `uiautomationcore.dll` exports that resolved to reliable header-plus-doc pairs are bound. Each method maps 1:1 to its DLL export. Names, parameter names, and order match Microsoft Learn.
32
+
33
+ ### Strings
34
+
35
+ `LPCWSTR` parameters take UTF-16LE NUL-terminated buffers.
36
+
37
+ ```ts
38
+ const wide = Buffer.from('Hello\0', 'utf16le');
39
+ UIAutomationCore.SomeFunction(wide.ptr);
40
+
41
+ const text = new TextDecoder('utf-16').decode(buffer).replace(/\0.*$/, '');
42
+ ```
43
+
44
+ ### Return types
45
+
46
+ - `HANDLE`, `HWND`, and other handle-like values -> `bigint`
47
+ - `DWORD`, `UINT`, `BOOL`, `INT`, `LONG` -> `number`
48
+ - `LPVOID`, `LPWSTR`, and other pointer-like values -> `Pointer`
49
+ - Win32 `BOOL` is `number` (0 or non-zero), not JS `boolean`. Do not compare with `=== true`.
50
+
51
+ ### Pointers, handles, out-parameters
52
+
53
+ - Pointer params (`LP*`, `P*`, `Pointer`): pass `buffer.ptr` from a caller-allocated `Buffer`.
54
+ - Handle params (`HANDLE`, `HWND`, and similar): pass a `bigint` value.
55
+ - Out-parameters: allocate a `Buffer`, pass `.ptr`, read the result after the call.
56
+
57
+ ```ts
58
+ const out = Buffer.alloc(8);
59
+ UIAutomationCore.SomeFunction(out.ptr);
60
+ const handle = out.readBigUInt64LE(0);
61
+ ```
62
+
63
+ ### By-value aggregates
64
+
65
+ `VARIANT` and `UiaPoint` parameters are modeled as pointer-shaped aliases because Windows x64 passes these aggregates indirectly at the ABI boundary. Pack the native layout into a caller-owned buffer and pass `.ptr`.
66
+
67
+ ### Nullability
68
+
69
+ - `| NULL` in a signature -> pass `null` (optional pointer).
70
+ - `| 0n` in a signature -> pass `0n` (optional handle).
71
+
72
+ ## Errors and Cleanup
73
+
74
+ Return values are raw. If a function returns a node or pattern handle, release it with `UiaNodeRelease`, `UiaPatternRelease`, or `UiaTextRangeRelease` as appropriate.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @bun-win32/uiautomationcore
2
+
3
+ Zero-dependency, zero-overhead Win32 UIAutomationCore bindings for [Bun](https://bun.sh) on Windows.
4
+
5
+ ## Overview
6
+
7
+ `@bun-win32/uiautomationcore` exposes the documented flat `uiautomationcore.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `UIAutomationCore`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.
8
+
9
+ The bindings are strongly typed for a smooth DX in TypeScript.
10
+
11
+ ## Features
12
+
13
+ - [Bun](https://bun.sh)-first ergonomics on Windows 10/11.
14
+ - Direct FFI to `uiautomationcore.dll` (UI Automation nodes, pattern objects, provider bridging, and event plumbing).
15
+ - In-source docs in `structs/UIAutomationCore.ts` with links to Microsoft Learn.
16
+ - Lazy binding on first call; optional eager preload (`UIAutomationCore.Preload()`).
17
+ - No wrapper overhead; calls map 1:1 to native APIs.
18
+ - Strongly-typed Win32 aliases (see `types/UIAutomationCore.ts`).
19
+
20
+ ## Requirements
21
+
22
+ - [Bun](https://bun.sh) runtime
23
+ - Windows 10 or later
24
+
25
+ ## Installation
26
+
27
+ ```sh
28
+ bun add @bun-win32/uiautomationcore
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```ts
34
+ import UIAutomationCore from '@bun-win32/uiautomationcore';
35
+
36
+ UIAutomationCore.Preload(['UiaClientsAreListening', 'UiaGetRootNode', 'UiaNodeRelease']);
37
+
38
+ console.log('UIA clients listening:', UIAutomationCore.UiaClientsAreListening() !== 0);
39
+
40
+ const rootNodeBuffer = Buffer.alloc(8);
41
+ const result = UIAutomationCore.UiaGetRootNode(rootNodeBuffer.ptr!);
42
+
43
+ if (result !== 0) {
44
+ throw new Error(`UiaGetRootNode failed: 0x${(result >>> 0).toString(16).padStart(8, '0')}`);
45
+ }
46
+
47
+ const rootNode = rootNodeBuffer.readBigUInt64LE(0);
48
+
49
+ try {
50
+ console.log('Root node handle:', `0x${rootNode.toString(16)}`);
51
+ } finally {
52
+ void UIAutomationCore.UiaNodeRelease(rootNode);
53
+ }
54
+ ```
55
+
56
+ > [!NOTE]
57
+ > AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.
58
+
59
+ ## Examples
60
+
61
+ Run the included examples:
62
+
63
+ ```sh
64
+ bun run example:focus-radar # animate UIA availability for the foreground window
65
+ bun run example:pattern-probe # inspect common pattern providers on the active window
66
+ ```
67
+
68
+ ## Notes
69
+
70
+ - Either rely on lazy binding or call `UIAutomationCore.Preload()`.
71
+ - `VARIANT` and `UiaPoint` parameters are modeled as caller-packed buffers; allocate the native layout locally and pass `.ptr`.
72
+ - Windows only. Bun runtime required.
package/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ import UIAutomationCore from './structs/UIAutomationCore';
2
+
3
+ export * from './types/UIAutomationCore';
4
+ export default UIAutomationCore;
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "author": "Stev Peifer <stev@bell.net>",
3
+ "bugs": {
4
+ "url": "https://github.com/ObscuritySRL/bun-win32/issues"
5
+ },
6
+ "dependencies": {
7
+ "@bun-win32/core": "1.1.2"
8
+ },
9
+ "description": "Zero-dependency, zero-overhead Win32 UIAUTOMATIONCORE bindings for Bun (FFI) on Windows.",
10
+ "devDependencies": {
11
+ "@bun-win32/user32": "3.0.20",
12
+ "@types/bun": "latest"
13
+ },
14
+ "exports": {
15
+ ".": "./index.ts"
16
+ },
17
+ "license": "MIT",
18
+ "module": "index.ts",
19
+ "name": "@bun-win32/uiautomationcore",
20
+ "peerDependencies": {
21
+ "typescript": "^5"
22
+ },
23
+ "private": false,
24
+ "homepage": "https://github.com/ObscuritySRL/bun-win32#readme",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git://github.com/ObscuritySRL/bun-win32.git",
28
+ "directory": "packages/uiautomationcore"
29
+ },
30
+ "type": "module",
31
+ "version": "1.0.0",
32
+ "main": "./index.ts",
33
+ "keywords": [
34
+ "accessibility",
35
+ "automation",
36
+ "bindings",
37
+ "bun",
38
+ "dll",
39
+ "ffi",
40
+ "typescript",
41
+ "uiautomation",
42
+ "uiautomationcore",
43
+ "win32",
44
+ "windows"
45
+ ],
46
+ "files": [
47
+ "AI.md",
48
+ "README.md",
49
+ "index.ts",
50
+ "structs/*.ts",
51
+ "types/*.ts"
52
+ ],
53
+ "sideEffects": false,
54
+ "engines": {
55
+ "bun": ">=1.1.0"
56
+ },
57
+ "scripts": {
58
+ "example:focus-radar": "bun ./example/focus-radar.ts",
59
+ "example:pattern-probe": "bun ./example/pattern-probe.ts"
60
+ }
61
+ }
@@ -0,0 +1,646 @@
1
+ import { type FFIFunction, FFIType } from 'bun:ffi';
2
+
3
+ import { Win32 } from '@bun-win32/core';
4
+
5
+ import type { AsyncContentLoadedState, AutomationIdentifierType, BOOL, BSTR, DWORD, DockPosition, EVENTID, GUID, HRESULT, HUIAEVENT, HUIANODE, HUIAPATTERNOBJECT, HUIATEXTRANGE, HWND, IAccessible, IRawElementProviderSimple, ITextRangeProvider, LONG, LPARAM, LPCWSTR, LRESULT, NULL, NavigateDirection, NormalizeState, NotificationKind, NotificationProcessing, PATTERNID, PBOOL, PBSTR, PHUIAEVENT, PHUIANODE, PHUIAPATTERNOBJECT, PHUIATEXTRANGE, PINT, PPIAccessible, PPIRawElementProviderSimple, PPIUnknown, PPROPERTYID, PPVOID, PROPERTYID, PSAFEARRAY, PSupportedTextSelection, PVARIANT, REFCLSID, REFIID, SAFEARRAY, ScrollAmount, StructureChangeType, SynchronizedInputType, TEXTATTRIBUTEID, TextEditChangeType, TextPatternRangeEndpoint, TextUnit, TreeScope, UiaCacheRequest, UiaChangeInfo, UiaCondition, UiaEventCallback, UiaFindParams, UiaPoint, UiaProviderCallback, VARIANT, WPARAM, WindowVisualState, int } from '../types/UIAutomationCore';
6
+
7
+ /**
8
+ * Thin, lazy-loaded FFI bindings for `UIAutomationCore.dll`.
9
+ *
10
+ * Each static method corresponds one-to-one with a Win32 export declared in `Symbols`.
11
+ * The first call to a method binds the underlying native symbol via `bun:ffi` and
12
+ * memoizes it on the class for subsequent calls. For bulk, up-front binding, use `Preload`.
13
+ *
14
+ * Symbols are defined with explicit `FFIType` signatures and kept alphabetized.
15
+ * You normally do not access `Symbols` directly; call the static methods or preload
16
+ * a subset for hot paths.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import UIAutomationCore from './structs/UIAutomationCore';
21
+ *
22
+ * const clientsListening = UIAutomationCore.UiaClientsAreListening();
23
+ * ```
24
+ */
25
+ class UIAutomationCore extends Win32 {
26
+ protected static override name = 'uiautomationcore.dll';
27
+
28
+ /** @inheritdoc */
29
+ protected static override readonly Symbols = {
30
+ DllCanUnloadNow: { args: [], returns: FFIType.i32 },
31
+ DllGetClassObject: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
32
+ DllRegisterServer: { args: [], returns: FFIType.i32 },
33
+ DllUnregisterServer: { args: [], returns: FFIType.i32 },
34
+ DockPattern_SetDockPosition: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
35
+ ExpandCollapsePattern_Collapse: { args: [FFIType.u64], returns: FFIType.i32 },
36
+ ExpandCollapsePattern_Expand: { args: [FFIType.u64], returns: FFIType.i32 },
37
+ GridPattern_GetItem: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
38
+ InvokePattern_Invoke: { args: [FFIType.u64], returns: FFIType.i32 },
39
+ ItemContainerPattern_FindItemByProperty: { args: [FFIType.u64, FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
40
+ LegacyIAccessiblePattern_DoDefaultAction: { args: [FFIType.u64], returns: FFIType.i32 },
41
+ LegacyIAccessiblePattern_GetIAccessible: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
42
+ LegacyIAccessiblePattern_Select: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
43
+ LegacyIAccessiblePattern_SetValue: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
44
+ MultipleViewPattern_GetViewName: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
45
+ MultipleViewPattern_SetCurrentView: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
46
+ RangeValuePattern_SetValue: { args: [FFIType.u64, FFIType.f64], returns: FFIType.i32 },
47
+ ScrollItemPattern_ScrollIntoView: { args: [FFIType.u64], returns: FFIType.i32 },
48
+ ScrollPattern_Scroll: { args: [FFIType.u64, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
49
+ ScrollPattern_SetScrollPercent: { args: [FFIType.u64, FFIType.f64, FFIType.f64], returns: FFIType.i32 },
50
+ SelectionItemPattern_AddToSelection: { args: [FFIType.u64], returns: FFIType.i32 },
51
+ SelectionItemPattern_RemoveFromSelection: { args: [FFIType.u64], returns: FFIType.i32 },
52
+ SelectionItemPattern_Select: { args: [FFIType.u64], returns: FFIType.i32 },
53
+ SynchronizedInputPattern_Cancel: { args: [FFIType.u64], returns: FFIType.i32 },
54
+ SynchronizedInputPattern_StartListening: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
55
+ TextPattern_get_DocumentRange: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
56
+ TextPattern_get_SupportedTextSelection: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
57
+ TextPattern_GetSelection: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
58
+ TextPattern_GetVisibleRanges: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
59
+ TextPattern_RangeFromChild: { args: [FFIType.u64, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
60
+ TextPattern_RangeFromPoint: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
61
+ TextRange_AddToSelection: { args: [FFIType.u64], returns: FFIType.i32 },
62
+ TextRange_Clone: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
63
+ TextRange_Compare: { args: [FFIType.u64, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
64
+ TextRange_CompareEndpoints: { args: [FFIType.u64, FFIType.i32, FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
65
+ TextRange_ExpandToEnclosingUnit: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
66
+ TextRange_FindAttribute: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
67
+ TextRange_FindText: { args: [FFIType.u64, FFIType.ptr, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
68
+ TextRange_GetAttributeValue: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
69
+ TextRange_GetBoundingRectangles: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
70
+ TextRange_GetChildren: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
71
+ TextRange_GetEnclosingElement: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
72
+ TextRange_GetText: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
73
+ TextRange_Move: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
74
+ TextRange_MoveEndpointByRange: { args: [FFIType.u64, FFIType.i32, FFIType.u64, FFIType.i32], returns: FFIType.i32 },
75
+ TextRange_MoveEndpointByUnit: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
76
+ TextRange_RemoveFromSelection: { args: [FFIType.u64], returns: FFIType.i32 },
77
+ TextRange_ScrollIntoView: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
78
+ TextRange_Select: { args: [FFIType.u64], returns: FFIType.i32 },
79
+ TogglePattern_Toggle: { args: [FFIType.u64], returns: FFIType.i32 },
80
+ TransformPattern_Move: { args: [FFIType.u64, FFIType.f64, FFIType.f64], returns: FFIType.i32 },
81
+ TransformPattern_Resize: { args: [FFIType.u64, FFIType.f64, FFIType.f64], returns: FFIType.i32 },
82
+ TransformPattern_Rotate: { args: [FFIType.u64, FFIType.f64], returns: FFIType.i32 },
83
+ UiaAddEvent: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
84
+ UiaClientsAreListening: { args: [], returns: FFIType.i32 },
85
+ UiaDisconnectAllProviders: { args: [], returns: FFIType.i32 },
86
+ UiaDisconnectProvider: { args: [FFIType.ptr], returns: FFIType.i32 },
87
+ UiaEventAddWindow: { args: [FFIType.u64, FFIType.u64], returns: FFIType.i32 },
88
+ UiaEventRemoveWindow: { args: [FFIType.u64, FFIType.u64], returns: FFIType.i32 },
89
+ UiaFind: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
90
+ UiaGetErrorDescription: { args: [FFIType.ptr], returns: FFIType.i32 },
91
+ UiaGetPatternProvider: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
92
+ UiaGetPropertyValue: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
93
+ UiaGetReservedMixedAttributeValue: { args: [FFIType.ptr], returns: FFIType.i32 },
94
+ UiaGetReservedNotSupportedValue: { args: [FFIType.ptr], returns: FFIType.i32 },
95
+ UiaGetRootNode: { args: [FFIType.ptr], returns: FFIType.i32 },
96
+ UiaGetRuntimeId: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
97
+ UiaGetUpdatedCache: { args: [FFIType.u64, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
98
+ UiaHasServerSideProvider: { args: [FFIType.u64], returns: FFIType.i32 },
99
+ UiaHostProviderFromHwnd: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
100
+ UiaHPatternObjectFromVariant: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
101
+ UiaHTextRangeFromVariant: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
102
+ UiaHUiaNodeFromVariant: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
103
+ UiaIAccessibleFromProvider: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
104
+ UiaLookupId: { args: [FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
105
+ UiaNavigate: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
106
+ UiaNodeFromFocus: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
107
+ UiaNodeFromHandle: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
108
+ UiaNodeFromPoint: { args: [FFIType.f64, FFIType.f64, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
109
+ UiaNodeFromProvider: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
110
+ UiaNodeRelease: { args: [FFIType.u64], returns: FFIType.i32 },
111
+ UiaPatternRelease: { args: [FFIType.u64], returns: FFIType.i32 },
112
+ UiaProviderForNonClient: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
113
+ UiaProviderFromIAccessible: { args: [FFIType.ptr, FFIType.i32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
114
+ UiaRaiseActiveTextPositionChangedEvent: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
115
+ UiaRaiseAsyncContentLoadedEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.f64], returns: FFIType.i32 },
116
+ UiaRaiseAutomationEvent: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
117
+ UiaRaiseAutomationPropertyChangedEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
118
+ UiaRaiseChangesEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
119
+ UiaRaiseNotificationEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
120
+ UiaRaiseStructureChangedEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
121
+ UiaRaiseTextEditTextChangedEvent: { args: [FFIType.ptr, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
122
+ UiaRegisterProviderCallback: { args: [FFIType.ptr], returns: FFIType.void },
123
+ UiaRemoveEvent: { args: [FFIType.u64], returns: FFIType.i32 },
124
+ UiaReturnRawElementProvider: { args: [FFIType.u64, FFIType.u64, FFIType.i64, FFIType.ptr], returns: FFIType.i64 },
125
+ UiaSetFocus: { args: [FFIType.u64], returns: FFIType.i32 },
126
+ UiaTextRangeRelease: { args: [FFIType.u64], returns: FFIType.i32 },
127
+ ValuePattern_SetValue: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
128
+ VirtualizedItemPattern_Realize: { args: [FFIType.u64], returns: FFIType.i32 },
129
+ WindowPattern_Close: { args: [FFIType.u64], returns: FFIType.i32 },
130
+ WindowPattern_SetWindowVisualState: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
131
+ WindowPattern_WaitForInputIdle: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
132
+ } as const satisfies Record<string, FFIFunction>;
133
+
134
+ // https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-dllcanunloadnow
135
+ public static DllCanUnloadNow(): HRESULT {
136
+ return UIAutomationCore.Load('DllCanUnloadNow')();
137
+ }
138
+
139
+ // https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-dllgetclassobject
140
+ public static DllGetClassObject(rclsid: REFCLSID, riid: REFIID, ppv: PPVOID): HRESULT {
141
+ return UIAutomationCore.Load('DllGetClassObject')(rclsid, riid, ppv);
142
+ }
143
+
144
+ // https://learn.microsoft.com/en-us/windows/win32/api/olectl/nf-olectl-dllregisterserver
145
+ public static DllRegisterServer(): HRESULT {
146
+ return UIAutomationCore.Load('DllRegisterServer')();
147
+ }
148
+
149
+ // https://learn.microsoft.com/en-us/windows/win32/api/olectl/nf-olectl-dllunregisterserver
150
+ public static DllUnregisterServer(): HRESULT {
151
+ return UIAutomationCore.Load('DllUnregisterServer')();
152
+ }
153
+
154
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-dockpattern_setdockposition
155
+ public static DockPattern_SetDockPosition(hobj: HUIAPATTERNOBJECT, dockPosition: DockPosition): HRESULT {
156
+ return UIAutomationCore.Load('DockPattern_SetDockPosition')(hobj, dockPosition);
157
+ }
158
+
159
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-expandcollapsepattern_collapse
160
+ public static ExpandCollapsePattern_Collapse(hobj: HUIAPATTERNOBJECT): HRESULT {
161
+ return UIAutomationCore.Load('ExpandCollapsePattern_Collapse')(hobj);
162
+ }
163
+
164
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-expandcollapsepattern_expand
165
+ public static ExpandCollapsePattern_Expand(hobj: HUIAPATTERNOBJECT): HRESULT {
166
+ return UIAutomationCore.Load('ExpandCollapsePattern_Expand')(hobj);
167
+ }
168
+
169
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-gridpattern_getitem
170
+ public static GridPattern_GetItem(hobj: HUIAPATTERNOBJECT, row: int, column: int, pResult: PHUIANODE): HRESULT {
171
+ return UIAutomationCore.Load('GridPattern_GetItem')(hobj, row, column, pResult);
172
+ }
173
+
174
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-invokepattern_invoke
175
+ public static InvokePattern_Invoke(hobj: HUIAPATTERNOBJECT): HRESULT {
176
+ return UIAutomationCore.Load('InvokePattern_Invoke')(hobj);
177
+ }
178
+
179
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-itemcontainerpattern_finditembyproperty
180
+ public static ItemContainerPattern_FindItemByProperty(hobj: HUIAPATTERNOBJECT, hnodeStartAfter: HUIANODE, propertyId: PROPERTYID, value: VARIANT, pFound: PHUIANODE): HRESULT {
181
+ return UIAutomationCore.Load('ItemContainerPattern_FindItemByProperty')(hobj, hnodeStartAfter, propertyId, value, pFound);
182
+ }
183
+
184
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-legacyiaccessiblepattern_dodefaultaction
185
+ public static LegacyIAccessiblePattern_DoDefaultAction(hobj: HUIAPATTERNOBJECT): HRESULT {
186
+ return UIAutomationCore.Load('LegacyIAccessiblePattern_DoDefaultAction')(hobj);
187
+ }
188
+
189
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-legacyiaccessiblepattern_getiaccessible
190
+ public static LegacyIAccessiblePattern_GetIAccessible(hobj: HUIAPATTERNOBJECT, pAccessible: PPIAccessible): HRESULT {
191
+ return UIAutomationCore.Load('LegacyIAccessiblePattern_GetIAccessible')(hobj, pAccessible);
192
+ }
193
+
194
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-legacyiaccessiblepattern_select
195
+ public static LegacyIAccessiblePattern_Select(hobj: HUIAPATTERNOBJECT, flagsSelect: LONG): HRESULT {
196
+ return UIAutomationCore.Load('LegacyIAccessiblePattern_Select')(hobj, flagsSelect);
197
+ }
198
+
199
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-legacyiaccessiblepattern_setvalue
200
+ public static LegacyIAccessiblePattern_SetValue(hobj: HUIAPATTERNOBJECT, szValue: LPCWSTR): HRESULT {
201
+ return UIAutomationCore.Load('LegacyIAccessiblePattern_SetValue')(hobj, szValue);
202
+ }
203
+
204
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-multipleviewpattern_getviewname
205
+ public static MultipleViewPattern_GetViewName(hobj: HUIAPATTERNOBJECT, viewId: int, ppStr: PBSTR): HRESULT {
206
+ return UIAutomationCore.Load('MultipleViewPattern_GetViewName')(hobj, viewId, ppStr);
207
+ }
208
+
209
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-multipleviewpattern_setcurrentview
210
+ public static MultipleViewPattern_SetCurrentView(hobj: HUIAPATTERNOBJECT, viewId: int): HRESULT {
211
+ return UIAutomationCore.Load('MultipleViewPattern_SetCurrentView')(hobj, viewId);
212
+ }
213
+
214
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-rangevaluepattern_setvalue
215
+ public static RangeValuePattern_SetValue(hobj: HUIAPATTERNOBJECT, val: number): HRESULT {
216
+ return UIAutomationCore.Load('RangeValuePattern_SetValue')(hobj, val);
217
+ }
218
+
219
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-scrollitempattern_scrollintoview
220
+ public static ScrollItemPattern_ScrollIntoView(hobj: HUIAPATTERNOBJECT): HRESULT {
221
+ return UIAutomationCore.Load('ScrollItemPattern_ScrollIntoView')(hobj);
222
+ }
223
+
224
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-scrollpattern_scroll
225
+ public static ScrollPattern_Scroll(hobj: HUIAPATTERNOBJECT, horizontalAmount: ScrollAmount, verticalAmount: ScrollAmount): HRESULT {
226
+ return UIAutomationCore.Load('ScrollPattern_Scroll')(hobj, horizontalAmount, verticalAmount);
227
+ }
228
+
229
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-scrollpattern_setscrollpercent
230
+ public static ScrollPattern_SetScrollPercent(hobj: HUIAPATTERNOBJECT, horizontalPercent: number, verticalPercent: number): HRESULT {
231
+ return UIAutomationCore.Load('ScrollPattern_SetScrollPercent')(hobj, horizontalPercent, verticalPercent);
232
+ }
233
+
234
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-selectionitempattern_addtoselection
235
+ public static SelectionItemPattern_AddToSelection(hobj: HUIAPATTERNOBJECT): HRESULT {
236
+ return UIAutomationCore.Load('SelectionItemPattern_AddToSelection')(hobj);
237
+ }
238
+
239
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-selectionitempattern_removefromselection
240
+ public static SelectionItemPattern_RemoveFromSelection(hobj: HUIAPATTERNOBJECT): HRESULT {
241
+ return UIAutomationCore.Load('SelectionItemPattern_RemoveFromSelection')(hobj);
242
+ }
243
+
244
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-selectionitempattern_select
245
+ public static SelectionItemPattern_Select(hobj: HUIAPATTERNOBJECT): HRESULT {
246
+ return UIAutomationCore.Load('SelectionItemPattern_Select')(hobj);
247
+ }
248
+
249
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-synchronizedinputpattern_cancel
250
+ public static SynchronizedInputPattern_Cancel(hobj: HUIAPATTERNOBJECT): HRESULT {
251
+ return UIAutomationCore.Load('SynchronizedInputPattern_Cancel')(hobj);
252
+ }
253
+
254
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-synchronizedinputpattern_startlistening
255
+ public static SynchronizedInputPattern_StartListening(hobj: HUIAPATTERNOBJECT, inputType: SynchronizedInputType): HRESULT {
256
+ return UIAutomationCore.Load('SynchronizedInputPattern_StartListening')(hobj, inputType);
257
+ }
258
+
259
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_get_documentrange
260
+ public static TextPattern_get_DocumentRange(hobj: HUIAPATTERNOBJECT, pRetVal: PHUIATEXTRANGE): HRESULT {
261
+ return UIAutomationCore.Load('TextPattern_get_DocumentRange')(hobj, pRetVal);
262
+ }
263
+
264
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_get_supportedtextselection
265
+ public static TextPattern_get_SupportedTextSelection(hobj: HUIAPATTERNOBJECT, pRetVal: PSupportedTextSelection): HRESULT {
266
+ return UIAutomationCore.Load('TextPattern_get_SupportedTextSelection')(hobj, pRetVal);
267
+ }
268
+
269
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_getselection
270
+ public static TextPattern_GetSelection(hobj: HUIAPATTERNOBJECT, pRetVal: PSAFEARRAY): HRESULT {
271
+ return UIAutomationCore.Load('TextPattern_GetSelection')(hobj, pRetVal);
272
+ }
273
+
274
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_getvisibleranges
275
+ public static TextPattern_GetVisibleRanges(hobj: HUIAPATTERNOBJECT, pRetVal: PSAFEARRAY): HRESULT {
276
+ return UIAutomationCore.Load('TextPattern_GetVisibleRanges')(hobj, pRetVal);
277
+ }
278
+
279
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_rangefromchild
280
+ public static TextPattern_RangeFromChild(hobj: HUIAPATTERNOBJECT, hnodeChild: HUIANODE, pRetVal: PHUIATEXTRANGE): HRESULT {
281
+ return UIAutomationCore.Load('TextPattern_RangeFromChild')(hobj, hnodeChild, pRetVal);
282
+ }
283
+
284
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textpattern_rangefrompoint
285
+ public static TextPattern_RangeFromPoint(hobj: HUIAPATTERNOBJECT, point: UiaPoint, pRetVal: PHUIATEXTRANGE): HRESULT {
286
+ return UIAutomationCore.Load('TextPattern_RangeFromPoint')(hobj, point, pRetVal);
287
+ }
288
+
289
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_addtoselection
290
+ public static TextRange_AddToSelection(hobj: HUIATEXTRANGE): HRESULT {
291
+ return UIAutomationCore.Load('TextRange_AddToSelection')(hobj);
292
+ }
293
+
294
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_clone
295
+ public static TextRange_Clone(hobj: HUIATEXTRANGE, pRetVal: PHUIATEXTRANGE): HRESULT {
296
+ return UIAutomationCore.Load('TextRange_Clone')(hobj, pRetVal);
297
+ }
298
+
299
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_compare
300
+ public static TextRange_Compare(hobj: HUIATEXTRANGE, range: HUIATEXTRANGE, pRetVal: PBOOL): HRESULT {
301
+ return UIAutomationCore.Load('TextRange_Compare')(hobj, range, pRetVal);
302
+ }
303
+
304
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_compareendpoints
305
+ public static TextRange_CompareEndpoints(hobj: HUIATEXTRANGE, endpoint: TextPatternRangeEndpoint, targetRange: HUIATEXTRANGE, targetEndpoint: TextPatternRangeEndpoint, pRetVal: PINT): HRESULT {
306
+ return UIAutomationCore.Load('TextRange_CompareEndpoints')(hobj, endpoint, targetRange, targetEndpoint, pRetVal);
307
+ }
308
+
309
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_expandtoenclosingunit
310
+ public static TextRange_ExpandToEnclosingUnit(hobj: HUIATEXTRANGE, unit: TextUnit): HRESULT {
311
+ return UIAutomationCore.Load('TextRange_ExpandToEnclosingUnit')(hobj, unit);
312
+ }
313
+
314
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_findattribute
315
+ public static TextRange_FindAttribute(hobj: HUIATEXTRANGE, attributeId: TEXTATTRIBUTEID, val: VARIANT, backward: BOOL, pRetVal: PHUIATEXTRANGE): HRESULT {
316
+ return UIAutomationCore.Load('TextRange_FindAttribute')(hobj, attributeId, val, backward, pRetVal);
317
+ }
318
+
319
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_findtext
320
+ public static TextRange_FindText(hobj: HUIATEXTRANGE, text: BSTR, backward: BOOL, ignoreCase: BOOL, pRetVal: PHUIATEXTRANGE): HRESULT {
321
+ return UIAutomationCore.Load('TextRange_FindText')(hobj, text, backward, ignoreCase, pRetVal);
322
+ }
323
+
324
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_getattributevalue
325
+ public static TextRange_GetAttributeValue(hobj: HUIATEXTRANGE, attributeId: TEXTATTRIBUTEID, pRetVal: PVARIANT): HRESULT {
326
+ return UIAutomationCore.Load('TextRange_GetAttributeValue')(hobj, attributeId, pRetVal);
327
+ }
328
+
329
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_getboundingrectangles
330
+ public static TextRange_GetBoundingRectangles(hobj: HUIATEXTRANGE, pRetVal: PSAFEARRAY): HRESULT {
331
+ return UIAutomationCore.Load('TextRange_GetBoundingRectangles')(hobj, pRetVal);
332
+ }
333
+
334
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_getchildren
335
+ public static TextRange_GetChildren(hobj: HUIATEXTRANGE, pRetVal: PSAFEARRAY): HRESULT {
336
+ return UIAutomationCore.Load('TextRange_GetChildren')(hobj, pRetVal);
337
+ }
338
+
339
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_getenclosingelement
340
+ public static TextRange_GetEnclosingElement(hobj: HUIATEXTRANGE, pRetVal: PHUIANODE): HRESULT {
341
+ return UIAutomationCore.Load('TextRange_GetEnclosingElement')(hobj, pRetVal);
342
+ }
343
+
344
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_gettext
345
+ public static TextRange_GetText(hobj: HUIATEXTRANGE, maxLength: int, pRetVal: PBSTR): HRESULT {
346
+ return UIAutomationCore.Load('TextRange_GetText')(hobj, maxLength, pRetVal);
347
+ }
348
+
349
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_move
350
+ public static TextRange_Move(hobj: HUIATEXTRANGE, unit: TextUnit, count: int, pRetVal: PINT): HRESULT {
351
+ return UIAutomationCore.Load('TextRange_Move')(hobj, unit, count, pRetVal);
352
+ }
353
+
354
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_moveendpointbyrange
355
+ public static TextRange_MoveEndpointByRange(hobj: HUIATEXTRANGE, endpoint: TextPatternRangeEndpoint, targetRange: HUIATEXTRANGE, targetEndpoint: TextPatternRangeEndpoint): HRESULT {
356
+ return UIAutomationCore.Load('TextRange_MoveEndpointByRange')(hobj, endpoint, targetRange, targetEndpoint);
357
+ }
358
+
359
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_moveendpointbyunit
360
+ public static TextRange_MoveEndpointByUnit(hobj: HUIATEXTRANGE, endpoint: TextPatternRangeEndpoint, unit: TextUnit, count: int, pRetVal: PINT): HRESULT {
361
+ return UIAutomationCore.Load('TextRange_MoveEndpointByUnit')(hobj, endpoint, unit, count, pRetVal);
362
+ }
363
+
364
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_removefromselection
365
+ public static TextRange_RemoveFromSelection(hobj: HUIATEXTRANGE): HRESULT {
366
+ return UIAutomationCore.Load('TextRange_RemoveFromSelection')(hobj);
367
+ }
368
+
369
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_scrollintoview
370
+ public static TextRange_ScrollIntoView(hobj: HUIATEXTRANGE, alignToTop: BOOL): HRESULT {
371
+ return UIAutomationCore.Load('TextRange_ScrollIntoView')(hobj, alignToTop);
372
+ }
373
+
374
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_select
375
+ public static TextRange_Select(hobj: HUIATEXTRANGE): HRESULT {
376
+ return UIAutomationCore.Load('TextRange_Select')(hobj);
377
+ }
378
+
379
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-togglepattern_toggle
380
+ public static TogglePattern_Toggle(hobj: HUIAPATTERNOBJECT): HRESULT {
381
+ return UIAutomationCore.Load('TogglePattern_Toggle')(hobj);
382
+ }
383
+
384
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-transformpattern_move
385
+ public static TransformPattern_Move(hobj: HUIAPATTERNOBJECT, x: number, y: number): HRESULT {
386
+ return UIAutomationCore.Load('TransformPattern_Move')(hobj, x, y);
387
+ }
388
+
389
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-transformpattern_resize
390
+ public static TransformPattern_Resize(hobj: HUIAPATTERNOBJECT, width: number, height: number): HRESULT {
391
+ return UIAutomationCore.Load('TransformPattern_Resize')(hobj, width, height);
392
+ }
393
+
394
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-transformpattern_rotate
395
+ public static TransformPattern_Rotate(hobj: HUIAPATTERNOBJECT, degrees: number): HRESULT {
396
+ return UIAutomationCore.Load('TransformPattern_Rotate')(hobj, degrees);
397
+ }
398
+
399
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaaddevent
400
+ public static UiaAddEvent(hnode: HUIANODE, eventId: EVENTID, pCallback: UiaEventCallback, scope: TreeScope, pProperties: PPROPERTYID | NULL, cProperties: int, pRequest: UiaCacheRequest, phEvent: PHUIAEVENT): HRESULT {
401
+ return UIAutomationCore.Load('UiaAddEvent')(hnode, eventId, pCallback, scope, pProperties, cProperties, pRequest, phEvent);
402
+ }
403
+
404
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaclientsarelistening
405
+ public static UiaClientsAreListening(): BOOL {
406
+ return UIAutomationCore.Load('UiaClientsAreListening')();
407
+ }
408
+
409
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiadisconnectallproviders
410
+ public static UiaDisconnectAllProviders(): HRESULT {
411
+ return UIAutomationCore.Load('UiaDisconnectAllProviders')();
412
+ }
413
+
414
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiadisconnectprovider
415
+ public static UiaDisconnectProvider(pProvider: IRawElementProviderSimple): HRESULT {
416
+ return UIAutomationCore.Load('UiaDisconnectProvider')(pProvider);
417
+ }
418
+
419
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaeventaddwindow
420
+ public static UiaEventAddWindow(hEvent: HUIAEVENT, hwnd: HWND): HRESULT {
421
+ return UIAutomationCore.Load('UiaEventAddWindow')(hEvent, hwnd);
422
+ }
423
+
424
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaeventremovewindow
425
+ public static UiaEventRemoveWindow(hEvent: HUIAEVENT, hwnd: HWND): HRESULT {
426
+ return UIAutomationCore.Load('UiaEventRemoveWindow')(hEvent, hwnd);
427
+ }
428
+
429
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiafind
430
+ public static UiaFind(hnode: HUIANODE, pParams: UiaFindParams, pRequest: UiaCacheRequest, ppRequestedData: PSAFEARRAY, ppOffsets: PSAFEARRAY, ppTreeStructures: PSAFEARRAY): HRESULT {
431
+ return UIAutomationCore.Load('UiaFind')(hnode, pParams, pRequest, ppRequestedData, ppOffsets, ppTreeStructures);
432
+ }
433
+
434
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiageterrordescription
435
+ public static UiaGetErrorDescription(pDescription: PBSTR): BOOL {
436
+ return UIAutomationCore.Load('UiaGetErrorDescription')(pDescription);
437
+ }
438
+
439
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetpatternprovider
440
+ public static UiaGetPatternProvider(hnode: HUIANODE, patternId: PATTERNID, phobj: PHUIAPATTERNOBJECT): HRESULT {
441
+ return UIAutomationCore.Load('UiaGetPatternProvider')(hnode, patternId, phobj);
442
+ }
443
+
444
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetpropertyvalue
445
+ public static UiaGetPropertyValue(hnode: HUIANODE, propertyId: PROPERTYID, pValue: PVARIANT): HRESULT {
446
+ return UIAutomationCore.Load('UiaGetPropertyValue')(hnode, propertyId, pValue);
447
+ }
448
+
449
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetreservedmixedattributevalue
450
+ public static UiaGetReservedMixedAttributeValue(punkMixedAttributeValue: PPIUnknown): HRESULT {
451
+ return UIAutomationCore.Load('UiaGetReservedMixedAttributeValue')(punkMixedAttributeValue);
452
+ }
453
+
454
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetreservednotsupportedvalue
455
+ public static UiaGetReservedNotSupportedValue(punkNotSupportedValue: PPIUnknown): HRESULT {
456
+ return UIAutomationCore.Load('UiaGetReservedNotSupportedValue')(punkNotSupportedValue);
457
+ }
458
+
459
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetrootnode
460
+ public static UiaGetRootNode(phnode: PHUIANODE): HRESULT {
461
+ return UIAutomationCore.Load('UiaGetRootNode')(phnode);
462
+ }
463
+
464
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetruntimeid
465
+ public static UiaGetRuntimeId(hnode: HUIANODE, pruntimeId: PSAFEARRAY): HRESULT {
466
+ return UIAutomationCore.Load('UiaGetRuntimeId')(hnode, pruntimeId);
467
+ }
468
+
469
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiagetupdatedcache
470
+ public static UiaGetUpdatedCache(hnode: HUIANODE, pRequest: UiaCacheRequest, normalizeState: NormalizeState, pNormalizeCondition: UiaCondition, ppRequestedData: PSAFEARRAY, ppTreeStructure: PBSTR): HRESULT {
471
+ return UIAutomationCore.Load('UiaGetUpdatedCache')(hnode, pRequest, normalizeState, pNormalizeCondition, ppRequestedData, ppTreeStructure);
472
+ }
473
+
474
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiahasserversideprovider
475
+ public static UiaHasServerSideProvider(hwnd: HWND): BOOL {
476
+ return UIAutomationCore.Load('UiaHasServerSideProvider')(hwnd);
477
+ }
478
+
479
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiahostproviderfromhwnd
480
+ public static UiaHostProviderFromHwnd(hwnd: HWND, ppProvider: PPIRawElementProviderSimple): HRESULT {
481
+ return UIAutomationCore.Load('UiaHostProviderFromHwnd')(hwnd, ppProvider);
482
+ }
483
+
484
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiahpatternobjectfromvariant
485
+ public static UiaHPatternObjectFromVariant(pvar: PVARIANT, phobj: PHUIAPATTERNOBJECT): HRESULT {
486
+ return UIAutomationCore.Load('UiaHPatternObjectFromVariant')(pvar, phobj);
487
+ }
488
+
489
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiahtextrangefromvariant
490
+ public static UiaHTextRangeFromVariant(pvar: PVARIANT, phtextrange: PHUIATEXTRANGE): HRESULT {
491
+ return UIAutomationCore.Load('UiaHTextRangeFromVariant')(pvar, phtextrange);
492
+ }
493
+
494
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiahuianodefromvariant
495
+ public static UiaHUiaNodeFromVariant(pvar: PVARIANT, phnode: PHUIANODE): HRESULT {
496
+ return UIAutomationCore.Load('UiaHUiaNodeFromVariant')(pvar, phnode);
497
+ }
498
+
499
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaiaccessiblefromprovider
500
+ public static UiaIAccessibleFromProvider(pProvider: IRawElementProviderSimple, dwFlags: DWORD, ppAccessible: PPIAccessible, pvarChild: PVARIANT): HRESULT {
501
+ return UIAutomationCore.Load('UiaIAccessibleFromProvider')(pProvider, dwFlags, ppAccessible, pvarChild);
502
+ }
503
+
504
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uialookupid
505
+ public static UiaLookupId(type: AutomationIdentifierType, pGuid: GUID): int {
506
+ return UIAutomationCore.Load('UiaLookupId')(type, pGuid);
507
+ }
508
+
509
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianavigate
510
+ public static UiaNavigate(hnode: HUIANODE, direction: NavigateDirection, pCondition: UiaCondition, pRequest: UiaCacheRequest, ppRequestedData: PSAFEARRAY, ppTreeStructure: PBSTR): HRESULT {
511
+ return UIAutomationCore.Load('UiaNavigate')(hnode, direction, pCondition, pRequest, ppRequestedData, ppTreeStructure);
512
+ }
513
+
514
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianodefromfocus
515
+ public static UiaNodeFromFocus(pRequest: UiaCacheRequest, ppRequestedData: PSAFEARRAY, ppTreeStructure: PBSTR): HRESULT {
516
+ return UIAutomationCore.Load('UiaNodeFromFocus')(pRequest, ppRequestedData, ppTreeStructure);
517
+ }
518
+
519
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianodefromhandle
520
+ public static UiaNodeFromHandle(hwnd: HWND, phnode: PHUIANODE): HRESULT {
521
+ return UIAutomationCore.Load('UiaNodeFromHandle')(hwnd, phnode);
522
+ }
523
+
524
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianodefrompoint
525
+ public static UiaNodeFromPoint(x: number, y: number, pRequest: UiaCacheRequest, ppRequestedData: PSAFEARRAY, ppTreeStructure: PBSTR): HRESULT {
526
+ return UIAutomationCore.Load('UiaNodeFromPoint')(x, y, pRequest, ppRequestedData, ppTreeStructure);
527
+ }
528
+
529
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianodefromprovider
530
+ public static UiaNodeFromProvider(pProvider: IRawElementProviderSimple, phnode: PHUIANODE): HRESULT {
531
+ return UIAutomationCore.Load('UiaNodeFromProvider')(pProvider, phnode);
532
+ }
533
+
534
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uianoderelease
535
+ public static UiaNodeRelease(hnode: HUIANODE): BOOL {
536
+ return UIAutomationCore.Load('UiaNodeRelease')(hnode);
537
+ }
538
+
539
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiapatternrelease
540
+ public static UiaPatternRelease(hobj: HUIAPATTERNOBJECT): BOOL {
541
+ return UIAutomationCore.Load('UiaPatternRelease')(hobj);
542
+ }
543
+
544
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaproviderfornonclient
545
+ public static UiaProviderForNonClient(hwnd: HWND, idObject: LONG, idChild: LONG, ppProvider: PPIRawElementProviderSimple): HRESULT {
546
+ return UIAutomationCore.Load('UiaProviderForNonClient')(hwnd, idObject, idChild, ppProvider);
547
+ }
548
+
549
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaproviderfromiaccessible
550
+ public static UiaProviderFromIAccessible(pAccessible: IAccessible, idChild: LONG, dwFlags: DWORD, ppProvider: PPIRawElementProviderSimple): HRESULT {
551
+ return UIAutomationCore.Load('UiaProviderFromIAccessible')(pAccessible, idChild, dwFlags, ppProvider);
552
+ }
553
+
554
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraiseactivetextpositionchangedevent
555
+ public static UiaRaiseActiveTextPositionChangedEvent(provider: IRawElementProviderSimple, textRange: ITextRangeProvider | NULL): HRESULT {
556
+ return UIAutomationCore.Load('UiaRaiseActiveTextPositionChangedEvent')(provider, textRange);
557
+ }
558
+
559
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraiseasynccontentloadedevent
560
+ public static UiaRaiseAsyncContentLoadedEvent(pProvider: IRawElementProviderSimple, asyncContentLoadedState: AsyncContentLoadedState, percentComplete: number): HRESULT {
561
+ return UIAutomationCore.Load('UiaRaiseAsyncContentLoadedEvent')(pProvider, asyncContentLoadedState, percentComplete);
562
+ }
563
+
564
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraiseautomationevent
565
+ public static UiaRaiseAutomationEvent(pProvider: IRawElementProviderSimple, id: EVENTID): HRESULT {
566
+ return UIAutomationCore.Load('UiaRaiseAutomationEvent')(pProvider, id);
567
+ }
568
+
569
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraiseautomationpropertychangedevent
570
+ public static UiaRaiseAutomationPropertyChangedEvent(pProvider: IRawElementProviderSimple, id: PROPERTYID, oldValue: VARIANT, newValue: VARIANT): HRESULT {
571
+ return UIAutomationCore.Load('UiaRaiseAutomationPropertyChangedEvent')(pProvider, id, oldValue, newValue);
572
+ }
573
+
574
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraisechangesevent
575
+ public static UiaRaiseChangesEvent(pProvider: IRawElementProviderSimple, eventIdCount: int, pUiaChanges: UiaChangeInfo): HRESULT {
576
+ return UIAutomationCore.Load('UiaRaiseChangesEvent')(pProvider, eventIdCount, pUiaChanges);
577
+ }
578
+
579
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraisenotificationevent
580
+ public static UiaRaiseNotificationEvent(provider: IRawElementProviderSimple, notificationKind: NotificationKind, notificationProcessing: NotificationProcessing, displayString: BSTR | NULL, activityId: BSTR): HRESULT {
581
+ return UIAutomationCore.Load('UiaRaiseNotificationEvent')(provider, notificationKind, notificationProcessing, displayString, activityId);
582
+ }
583
+
584
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraisestructurechangedevent
585
+ public static UiaRaiseStructureChangedEvent(pProvider: IRawElementProviderSimple, structureChangeType: StructureChangeType, pRuntimeId: PINT, cRuntimeIdLen: int): HRESULT {
586
+ return UIAutomationCore.Load('UiaRaiseStructureChangedEvent')(pProvider, structureChangeType, pRuntimeId, cRuntimeIdLen);
587
+ }
588
+
589
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraisetextedittextchangedevent
590
+ public static UiaRaiseTextEditTextChangedEvent(pProvider: IRawElementProviderSimple, textEditChangeType: TextEditChangeType, pChangedData: SAFEARRAY): HRESULT {
591
+ return UIAutomationCore.Load('UiaRaiseTextEditTextChangedEvent')(pProvider, textEditChangeType, pChangedData);
592
+ }
593
+
594
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaregisterprovidercallback
595
+ public static UiaRegisterProviderCallback(pCallback: UiaProviderCallback): void {
596
+ return UIAutomationCore.Load('UiaRegisterProviderCallback')(pCallback);
597
+ }
598
+
599
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaremoveevent
600
+ public static UiaRemoveEvent(hEvent: HUIAEVENT): HRESULT {
601
+ return UIAutomationCore.Load('UiaRemoveEvent')(hEvent);
602
+ }
603
+
604
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiareturnrawelementprovider
605
+ public static UiaReturnRawElementProvider(hwnd: HWND, wParam: WPARAM, lParam: LPARAM, el: IRawElementProviderSimple | NULL): LRESULT {
606
+ return UIAutomationCore.Load('UiaReturnRawElementProvider')(hwnd, wParam, lParam, el);
607
+ }
608
+
609
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiasetfocus
610
+ public static UiaSetFocus(hnode: HUIANODE): HRESULT {
611
+ return UIAutomationCore.Load('UiaSetFocus')(hnode);
612
+ }
613
+
614
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiatextrangerelease
615
+ public static UiaTextRangeRelease(hobj: HUIATEXTRANGE): BOOL {
616
+ return UIAutomationCore.Load('UiaTextRangeRelease')(hobj);
617
+ }
618
+
619
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-valuepattern_setvalue
620
+ public static ValuePattern_SetValue(hobj: HUIAPATTERNOBJECT, pVal: LPCWSTR): HRESULT {
621
+ return UIAutomationCore.Load('ValuePattern_SetValue')(hobj, pVal);
622
+ }
623
+
624
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-virtualizeditempattern_realize
625
+ public static VirtualizedItemPattern_Realize(hobj: HUIAPATTERNOBJECT): HRESULT {
626
+ return UIAutomationCore.Load('VirtualizedItemPattern_Realize')(hobj);
627
+ }
628
+
629
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-windowpattern_close
630
+ public static WindowPattern_Close(hobj: HUIAPATTERNOBJECT): HRESULT {
631
+ return UIAutomationCore.Load('WindowPattern_Close')(hobj);
632
+ }
633
+
634
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-windowpattern_setwindowvisualstate
635
+ public static WindowPattern_SetWindowVisualState(hobj: HUIAPATTERNOBJECT, state: WindowVisualState): HRESULT {
636
+ return UIAutomationCore.Load('WindowPattern_SetWindowVisualState')(hobj, state);
637
+ }
638
+
639
+ // https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-windowpattern_waitforinputidle
640
+ public static WindowPattern_WaitForInputIdle(hobj: HUIAPATTERNOBJECT, milliseconds: int, pResult: PBOOL): HRESULT {
641
+ return UIAutomationCore.Load('WindowPattern_WaitForInputIdle')(hobj, milliseconds, pResult);
642
+ }
643
+
644
+ }
645
+
646
+ export default UIAutomationCore;
@@ -0,0 +1,193 @@
1
+ import type { Pointer } from 'bun:ffi';
2
+
3
+ export type { BOOL, DWORD, HRESULT, HWND, LONG, LPARAM, LPCWSTR, LRESULT, NULL, WPARAM } from '@bun-win32/core';
4
+
5
+ export const UIA_E_ELEMENTNOTAVAILABLE = 0x8004_0201;
6
+ export const UIA_E_ELEMENTNOTENABLED = 0x8004_0200;
7
+ export const UIA_E_INVALIDOPERATION = 0x8013_1509;
8
+ export const UIA_E_NOCLICKABLEPOINT = 0x8004_0202;
9
+ export const UIA_E_NOTSUPPORTED = 0x8004_0204;
10
+ export const UIA_E_PROXYASSEMBLYNOTLOADED = 0x8004_0203;
11
+ export const UIA_E_TIMEOUT = 0x8013_1505;
12
+ export const UIA_IAFP_DEFAULT = 0x0000;
13
+ export const UIA_IAFP_UNWRAP_BRIDGE = 0x0001;
14
+ export const UIA_PFIA_DEFAULT = 0x0000;
15
+ export const UIA_PFIA_UNWRAP_BRIDGE = 0x0001;
16
+ export const UiaAppendRuntimeId = 3;
17
+ export const UiaRootObjectId = -25;
18
+
19
+ export enum AsyncContentLoadedState {
20
+ AsyncContentLoadedState_Beginning = 0,
21
+ AsyncContentLoadedState_Progress = 1,
22
+ AsyncContentLoadedState_Completed = 2,
23
+ }
24
+
25
+ export enum AutomationIdentifierType {
26
+ AutomationIdentifierType_Property = 0,
27
+ AutomationIdentifierType_Pattern = 1,
28
+ AutomationIdentifierType_Event = 2,
29
+ AutomationIdentifierType_ControlType = 3,
30
+ AutomationIdentifierType_TextAttribute = 4,
31
+ AutomationIdentifierType_LandmarkType = 5,
32
+ AutomationIdentifierType_Annotation = 6,
33
+ AutomationIdentifierType_Changes = 7,
34
+ AutomationIdentifierType_Style = 8,
35
+ }
36
+
37
+ export enum DockPosition {
38
+ DockPosition_Top = 0,
39
+ DockPosition_Left = 1,
40
+ DockPosition_Bottom = 2,
41
+ DockPosition_Right = 3,
42
+ DockPosition_Fill = 4,
43
+ DockPosition_None = 5,
44
+ }
45
+
46
+ export enum NavigateDirection {
47
+ NavigateDirection_Parent = 0,
48
+ NavigateDirection_NextSibling = 1,
49
+ NavigateDirection_PreviousSibling = 2,
50
+ NavigateDirection_FirstChild = 3,
51
+ NavigateDirection_LastChild = 4,
52
+ }
53
+
54
+ export enum NormalizeState {
55
+ NormalizeState_None = 0,
56
+ NormalizeState_View = 1,
57
+ NormalizeState_Custom = 2,
58
+ }
59
+
60
+ export enum NotificationKind {
61
+ NotificationKind_ItemAdded = 0,
62
+ NotificationKind_ItemRemoved = 1,
63
+ NotificationKind_ActionCompleted = 2,
64
+ NotificationKind_ActionAborted = 3,
65
+ NotificationKind_Other = 4,
66
+ }
67
+
68
+ export enum NotificationProcessing {
69
+ NotificationProcessing_ImportantAll = 0,
70
+ NotificationProcessing_ImportantMostRecent = 1,
71
+ NotificationProcessing_All = 2,
72
+ NotificationProcessing_MostRecent = 3,
73
+ NotificationProcessing_CurrentThenMostRecent = 4,
74
+ }
75
+
76
+ export enum ProviderType {
77
+ ProviderType_BaseHwnd = 0,
78
+ ProviderType_Proxy = 1,
79
+ ProviderType_NonClientArea = 2,
80
+ }
81
+
82
+ export enum ScrollAmount {
83
+ ScrollAmount_LargeDecrement = 0,
84
+ ScrollAmount_SmallDecrement = 1,
85
+ ScrollAmount_NoAmount = 2,
86
+ ScrollAmount_LargeIncrement = 3,
87
+ ScrollAmount_SmallIncrement = 4,
88
+ }
89
+
90
+ export enum StructureChangeType {
91
+ StructureChangeType_ChildAdded = 0,
92
+ StructureChangeType_ChildRemoved = 1,
93
+ StructureChangeType_ChildrenInvalidated = 2,
94
+ StructureChangeType_ChildrenBulkAdded = 3,
95
+ StructureChangeType_ChildrenBulkRemoved = 4,
96
+ StructureChangeType_ChildrenReordered = 5,
97
+ }
98
+
99
+ export enum SupportedTextSelection {
100
+ SupportedTextSelection_None = 0,
101
+ SupportedTextSelection_Single = 1,
102
+ SupportedTextSelection_Multiple = 2,
103
+ }
104
+
105
+ export enum SynchronizedInputType {
106
+ SynchronizedInputType_KeyUp = 0x0000_0001,
107
+ SynchronizedInputType_KeyDown = 0x0000_0002,
108
+ SynchronizedInputType_LeftMouseUp = 0x0000_0004,
109
+ SynchronizedInputType_LeftMouseDown = 0x0000_0008,
110
+ SynchronizedInputType_RightMouseUp = 0x0000_0010,
111
+ SynchronizedInputType_RightMouseDown = 0x0000_0020,
112
+ }
113
+
114
+ export enum TextEditChangeType {
115
+ TextEditChangeType_None = 0,
116
+ TextEditChangeType_AutoCorrect = 1,
117
+ TextEditChangeType_Composition = 2,
118
+ TextEditChangeType_CompositionFinalized = 3,
119
+ TextEditChangeType_AutoComplete = 4,
120
+ }
121
+
122
+ export enum TextPatternRangeEndpoint {
123
+ TextPatternRangeEndpoint_Start = 0,
124
+ TextPatternRangeEndpoint_End = 1,
125
+ }
126
+
127
+ export enum TextUnit {
128
+ TextUnit_Character = 0,
129
+ TextUnit_Format = 1,
130
+ TextUnit_Word = 2,
131
+ TextUnit_Line = 3,
132
+ TextUnit_Paragraph = 4,
133
+ TextUnit_Page = 5,
134
+ TextUnit_Document = 6,
135
+ }
136
+
137
+ export enum TreeScope {
138
+ TreeScope_None = 0x0000_0000,
139
+ TreeScope_Element = 0x0000_0001,
140
+ TreeScope_Children = 0x0000_0002,
141
+ TreeScope_Descendants = 0x0000_0004,
142
+ TreeScope_Parent = 0x0000_0008,
143
+ TreeScope_Ancestors = 0x0000_0010,
144
+ TreeScope_Subtree = TreeScope_Element | TreeScope_Children | TreeScope_Descendants,
145
+ }
146
+
147
+ export enum WindowVisualState {
148
+ WindowVisualState_Normal = 0,
149
+ WindowVisualState_Maximized = 1,
150
+ WindowVisualState_Minimized = 2,
151
+ }
152
+
153
+ export type BSTR = Pointer;
154
+ export type EVENTID = number;
155
+ export type GUID = Pointer;
156
+ export type HUIAEVENT = bigint;
157
+ export type HUIANODE = bigint;
158
+ export type HUIAPATTERNOBJECT = bigint;
159
+ export type HUIATEXTRANGE = bigint;
160
+ export type IAccessible = Pointer;
161
+ export type IRawElementProviderSimple = Pointer;
162
+ export type ITextRangeProvider = Pointer;
163
+ export type int = number;
164
+ export type IUnknown = Pointer;
165
+ export type PATTERNID = number;
166
+ export type PBOOL = Pointer;
167
+ export type PBSTR = Pointer;
168
+ export type PHUIAEVENT = Pointer;
169
+ export type PHUIANODE = Pointer;
170
+ export type PHUIAPATTERNOBJECT = Pointer;
171
+ export type PHUIATEXTRANGE = Pointer;
172
+ export type PINT = Pointer;
173
+ export type PPIAccessible = Pointer;
174
+ export type PPIRawElementProviderSimple = Pointer;
175
+ export type PPIUnknown = Pointer;
176
+ export type PPROPERTYID = Pointer;
177
+ export type PPVOID = Pointer;
178
+ export type PROPERTYID = number;
179
+ export type PSAFEARRAY = Pointer;
180
+ export type PSupportedTextSelection = Pointer;
181
+ export type PVARIANT = Pointer;
182
+ export type REFCLSID = Pointer;
183
+ export type REFIID = Pointer;
184
+ export type SAFEARRAY = Pointer;
185
+ export type TEXTATTRIBUTEID = number;
186
+ export type UiaCacheRequest = Pointer;
187
+ export type UiaChangeInfo = Pointer;
188
+ export type UiaCondition = Pointer;
189
+ export type UiaEventCallback = Pointer;
190
+ export type UiaFindParams = Pointer;
191
+ export type UiaPoint = Pointer;
192
+ export type UiaProviderCallback = Pointer;
193
+ export type VARIANT = Pointer;