Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IUIAutomation2::AutoSetFocus property

Specifies whether calls to UI Automation control pattern methods automatically set focus to the target element.

This property is read/write.

Syntax


HRESULT put_AutoSetFocus(
  [in]   BOOL autoSetFocus
);

HRESULT get_AutoSetFocus(
  [out]  BOOL *autoSetFocus
);

Property value

TRUE if calls to UI Automation control pattern methods automatically set focus to the target element; otherwise FALSE.

Remarks

By default, most UI Automation methods that perform an action on an element, such as IUIAutomationInvokePattern::Invoke and IUIAutomationValuePattern::SetValue, set focus to the element before performing the action. For most applications, setting the focus results in a more consistent user experience. In situations where setting the focus would be disruptive, such as automating a drop-down menu, you can set AutoSetFocus to FALSE to prevent UI Automation methods from setting the focus.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

UIAutomationClient.h (include UIAutomation.h)

IDL

UIAutomationClient.idl

DLL

UIAutomationCore.dll

See also

IUIAutomation2

 

 

Community Additions

Show:
© 2014 Microsoft