tests/cefclient/browser/osr_accessibility_node_win.cc
// Check and returns Accessibility State for element from accessibility tree
Check and returns Accessibility State for element from accessibility tree
Check and returns Accessibility State for element from accessibility tree
STDMETHODIMP CefIAccessible::get_accState(VARIANT varChild,
                                          VARIANT* pvarState) {
  HRESULT retCode = DATACHECK(node_);
  if (SUCCEEDED(retCode)) {
    if (pvarState) {
      pvarState->vt = VT_I4;
      pvarState->lVal =
          (GetFocus() == node_->GetWindowHandle()) ? STATE_SYSTEM_FOCUSED : 0;
      pvarState->lVal |= STATE_SYSTEM_PRESSED;
      pvarState->lVal |= STATE_SYSTEM_FOCUSABLE;
      if (varChild.lVal == CHILDID_SELF) {
        DWORD dwStyle = GetWindowLong(node_->GetWindowHandle(), GWL_STYLE);
        pvarState->lVal |=
            ((dwStyle & WS_VISIBLE) == 0) ? STATE_SYSTEM_INVISIBLE : 0;
        pvarState->lVal |=
            ((dwStyle & WS_DISABLED) > 0) ? STATE_SYSTEM_UNAVAILABLE : 0;
      }
    } else {
      retCode = E_INVALIDARG;
    }
  }
  return retCode;
}
STDMETHODIMP CefIAccessible :: get_accState ( VARIANT varChild , VARIANT * pvarState ) { HRESULT retCode = DATACHECK ( node_ ) ; if ( SUCCEEDED ( retCode ) ) { if ( pvarState ) { pvarState -> vt = VT_I4 ; pvarState -> lVal = ( GetFocus ( ) == node_ -> GetWindowHandle ( ) ) ? STATE_SYSTEM_FOCUSED : 0 ; pvarState -> lVal |= STATE_SYSTEM_PRESSED ; pvarState -> lVal |= STATE_SYSTEM_FOCUSABLE ; if ( varChild . lVal == CHILDID_SELF ) { DWORD dwStyle = GetWindowLong ( node_ -> GetWindowHandle ( ) , GWL_STYLE ) ; pvarState -> lVal |= ( ( dwStyle & WS_VISIBLE ) == 0 ) ? STATE_SYSTEM_INVISIBLE : 0 ; pvarState -> lVal |= ( ( dwStyle & WS_DISABLED ) > 0 ) ? STATE_SYSTEM_UNAVAILABLE : 0 ; } } else { retCode = E_INVALIDARG ; } } return retCode ; }
Check and returns Accessibility State for element from accessibility tree
Check and returns Accessibility State for element from accessibility tree
// For child