cachedFirstSelectedItem property

IUIAutomationElement? get cachedFirstSelectedItem

Gets a cached IUIAutomationElement object representing the first item in a group of selected items.

To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionpattern2-get_cachedfirstselecteditem.

Implementation

IUIAutomationElement? get cachedFirstSelectedItem {
  final retVal = adaptiveCalloc<VTablePointer>();
  final hr$ = HRESULT(_get_CachedFirstSelectedItemFn(ptr, retVal));
  if (hr$.isError) {
    free(retVal);
    throw WindowsException(hr$);
  }
  final result$ = retVal.value;
  free(retVal);
  if (result$.isNull) return null;
  return .new(result$);
}