Entrainement
Module
Accessibility design specs with annotations - Training
Accessibility design specs with annotations
Ce navigateur n’est plus pris en charge.
Effectuez une mise à niveau vers Microsoft Edge pour tirer parti des dernières fonctionnalités, des mises à jour de sécurité et du support technique.
Pour utiliser une annotation directe pour remplacer la valeur d’une propriété
L’exemple suivant montre comment annoter la propriété Role d’un contrôle de texte statique.
HRESULT CMyTextControl::SetAccessibleProperties()
{
// COM is assumed to be initialized...
IAccPropServices* pAccPropServices = NULL;
HRESULT hr = CoCreateInstance(CLSID_AccPropServices,
NULL, CLSCTX_SERVER, IID_IAccPropServices,
(void**)&pAccPropServices);
if (SUCCEEDED(hr))
{
// Annotating the Role of this object to be STATICTEXT
VARIANT var;
var.vt = VT_I4;
var.lVal = ROLE_SYSTEM_STATICTEXT;
hr = pAccPropServices->SetHwndProp(_hwnd,
OBJID_CLIENT,
CHILDID_SELF,
PROPID_ACC_ROLE,
var);
pAccPropServices->Release();
}
return hr;
}
Les propriétés Microsoft Active Accessibility suivantes peuvent être annotées lors de la spécification d’une valeur (où la valeur doit être du type noté) pour l’annotation directe. Pour remplacer ou ajouter une propriété Microsoft UI Automation à un contrôle, vous pouvez spécifier l’ID de propriété UI Automation au lieu de l’ID de propriété Microsoft Active Accessibility. Pour obtenir la liste des ID de UI Automation, consultez Identificateurs de propriétés.
Propriété | Type |
---|---|
PROPID_ACC_NAME | VT_BSTR |
PROPID_ACC_DESCRIPTION | VT_BSTR |
PROPID_ACC_ROLE | VT_I4 |
PROPID_ACC_STATE | VT_I4 |
PROPID_ACC_HELP | VT_BSTR |
PROPID_ACC_KEYBOARDSHORTCUT | VT_BSTR |
PROPID_ACC_DEFAULTACTION | VT_BSTR |
PROPID_ACC_VALUEMAP | VT_BSTR |
PROPID_ACC_ROLEMAP | VT_BSTR |
PROPID_ACC_STATEMAP | VT_BSTR |
Entrainement
Module
Accessibility design specs with annotations - Training
Accessibility design specs with annotations