setFocus method

void setFocus()

Sets the keyboard focus to this UI Automation element.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus.

Implementation

@pragma('vm:prefer-inline')
void setFocus() {
  final hr$ = HRESULT(_SetFocusFn(ptr));
  if (hr$.isError) throw WindowsException(hr$);
}