Tools
Utility helpers ported from FlaUI.Core.Tools. ItemRealizer realizes virtualized items,
AccessibilityTextResolver resolves MSAA role/state text, WindowsStoreAppLauncher launches UWP
apps, LocalizedStrings exposes culture-aware UI strings, and SystemInfo reports CPU/memory
metrics (pure-Python via psutil).
flaui.core.tools.ItemRealizer
Realizes virtualized items in a container so they become full members of the automation tree.
Mirrors C# FlaUI.Core.Tools.ItemRealizer; delegates to the native implementation, which uses
the Scroll and ItemContainer patterns to walk and realize each item.
realize_items(item_container_element)
staticmethod
Realize all virtualized items in the given container element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_container_element
|
AutomationElement
|
The container whose items should be realized. |
required |
Source code in flaui/core/tools.py
flaui.core.tools.AccessibilityTextResolver
Resolves human-readable text for MSAA accessibility roles and states.
Mirrors C# FlaUI.Core.Tools.AccessibilityTextResolver (a thin wrapper over oleacc).
Roles/states are the C# AccessibilityRole / AccessibilityState values, e.g. those
returned by element.patterns.legacy_i_accessible.pattern.role.value.
get_role_text(role)
staticmethod
Return the localized text for an accessibility role.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
Any
|
The C# |
required |
Returns:
| Type | Description |
|---|---|
str
|
Human-readable role text (e.g. |
Source code in flaui/core/tools.py
get_state_bit_text(state)
staticmethod
Return the localized text for a single accessibility state bit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
The C# |
required |
Returns:
| Type | Description |
|---|---|
str
|
Human-readable state text (e.g. |
Source code in flaui/core/tools.py
get_state_text(state)
staticmethod
Return the comma-separated localized text for all set accessibility state flags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
The C# |
required |
Returns:
| Type | Description |
|---|---|
str
|
Comma-separated human-readable state text. |
Source code in flaui/core/tools.py
flaui.core.tools.WindowsStoreAppLauncher
Launches Windows Store (UWP) apps by their Application User Model ID.
Mirrors C# FlaUI.Core.Tools.WindowsStoreAppLauncher, which uses the COM
IApplicationActivationManager to activate the app.
launch(app_user_model_id, arguments='')
staticmethod
Launch a Windows Store app and return its process id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_model_id
|
str
|
The Application User Model ID of the app to launch. |
required |
arguments
|
str
|
Arguments to pass to the app, defaults to an empty string. |
''
|
Returns:
| Type | Description |
|---|---|
int
|
The process id of the launched app. |
Source code in flaui/core/tools.py
flaui.core.tools.LocalizedStrings
Culture-aware UI strings used by FlaUI (e.g. scroll-bar names per framework/locale).
Mirrors C# FlaUI.Core.Tools.LocalizedStrings; values are read from the native class, which
selects strings based on the current OS culture.
horizontal_scroll_bar()
classmethod
Return the localized name of a horizontal scroll bar.
Returns:
| Type | Description |
|---|---|
str
|
Localized horizontal scroll-bar name. |
vertical_scroll_bar()
classmethod
Return the localized name of a vertical scroll bar.
Returns:
| Type | Description |
|---|---|
str
|
Localized vertical scroll-bar name. |
flaui.core.tools.SystemInfo
System CPU and memory metrics, implemented in pure Python via :mod:psutil.
Python-native equivalent of C# FlaUI.Core.Tools.SystemInfo (the C# version uses
PerformanceCounter / WMI). Memory values are bytes; percentages are 0-100 floats.
cpu_usage()
staticmethod
Return the current system-wide CPU utilization as a percentage (0-100).
Returns:
| Type | Description |
|---|---|
float
|
CPU usage percentage. |
physical_memory_free()
staticmethod
Return the available physical memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Available physical memory (bytes). |
physical_memory_free_percent()
staticmethod
Return the free physical memory as a percentage (0-100).
Returns:
| Type | Description |
|---|---|
float
|
Free physical memory percentage. |
physical_memory_total()
staticmethod
Return the total physical memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Total physical memory (bytes). |
physical_memory_used()
staticmethod
Return the used physical memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Used physical memory (bytes). |
physical_memory_used_percent()
staticmethod
Return the used physical memory as a percentage (0-100).
Returns:
| Type | Description |
|---|---|
float
|
Used physical memory percentage. |
virtual_memory_free()
staticmethod
Return the free virtual (swap/page-file) memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Free virtual memory (bytes). |
virtual_memory_total()
staticmethod
Return the total virtual (swap/page-file) memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Total virtual memory (bytes). |
virtual_memory_used()
staticmethod
Return the used virtual (swap/page-file) memory in bytes.
Returns:
| Type | Description |
|---|---|
int
|
Used virtual memory (bytes). |