getCurrentPropertyValue method
Retrieves the current value of a property for this UI Automation element.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue.
Implementation
Pointer<VARIANT> getCurrentPropertyValue(UIA_PROPERTY_ID propertyId) {
final retVal = adaptiveCalloc<VARIANT>();
final hr$ = HRESULT(_GetCurrentPropertyValueFn(ptr, propertyId, retVal));
if (hr$.isError) {
free(retVal);
throw WindowsException(hr$);
}
return retVal;
}