How to interpret UIAutomation get_CurrentState parameter?

Leonardo 91 Reputation points

Im using this code to get the value of LegacyIAccessible.State: show in the picture below:

IUIAutomationElement* element = nullptr;  
hr = elementArray->GetElement(nItem, &element);  
BSTR bstrName;  
hr = element->get_CurrentName(&bstrName);  
UIA_HWND hwnd;  
hr = element->get_CurrentNativeWindowHandle(&hwnd);  
BSTR bstrId;  
hr = element->get_CurrentAutomationId(&bstrId);  
RECT rect;  
hr = element->get_CurrentBoundingRectangle(&rect);  
IUIAutomationLegacyIAccessiblePattern* pattern;  
element->GetCurrentPatternAs(UIA_LegacyIAccessiblePatternId, IID_PPV_ARGS(&pattern));  
DWORD state = 0;  

When the value of state is 1074790400 witch in hex represent 0x40100000

How i could interpret this value to get these values in the picture? i mean: focusable has popup (0x40100000).


Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,412 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,519 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,461 Reputation points

    In Oleacc.h :

    #define	STATE_SYSTEM_FOCUSABLE	( 0x100000 )  
    #define	STATE_SYSTEM_HASPOPUP	( 0x40000000 )  

  2. Xiaopo Yang - MSFT 11,256 Reputation points Microsoft Vendor

    According to LegacyIAccessible Control Pattern, Use the GetStateText function to retrieve localized string.

    0 comments No comments