IAccessible Implementation Sample for a Custom Push Button Published!


Fiona, one of the devs on my team VSCore, has put together a really nice sample on how to implement IAccessible for a Custom Push Button. If you’re using standard Windows controls, you get MSAA implemented for free. However, if you’re using custom drawn controls, it is imperative that you implement MSAA (aka IAccessible); otherwise, the control will not be accessible to Assistive Technologies.

There’s a lot of documentation on MSDN how to support MSAA, and now you have an actual sample of how to implement IAccessible! Just point one of the MSAA SDK Testing Tools (Inspect or AccExplorer) at the custom button for a proof of concept.

This sample follows the MSAA SDK guidelines on how to implement IAccessible for a push button.

The sample is located on GotDotNet at

http://www.gotdotnet.com/Community/Workspaces/Workspace.aspx?id=4b5530a0-c900-421b-8ed6-7407997fa979

Enjoy!

Comments (4)

  1. Consider this article your one-stop shop for all things IAccessible.  Below is a summary of the…

  2. Glant says:

    I want to ask you a question about accessibility.

    I am writing a program to access MSN messenger. for example, there is friend "Amay" in my

    MSN contact list, I want to get his name and his note through my program when I hover on his

    name in MSN.

    What I use is AccessibleObjectFromPoint(), but it failed to get object name and description

    for a contact of MSN.

    I think that MSN supports Accessibility well as Inspect32 can get these info. Following are

    the info gotten by Inspect32:

    /***************************************************************************

    How found: Focus [o:0x6010078,c:0x0]

    hwnd=0x00010212 32bit class="DirectUIHWND" style=0x56000000 ex=0x0

    Info: IAcc = 0x00157748 VarChild:[VT_I4=0x0]

    Impl: Remote native IAccessible

    Annotation ID: [not supported]

    Name: "Amay .Net开发和赴IBM系统测试(脱机) "

    Value: "Amay .Net开发和赴IBM系统测试(脱机) "

    Role: 框线项目

    State: 已选择,已设定焦点,可选择

    Location: {l:729, t:271, w:262, h:18}

    Description: "Amay .Net开发和赴IBM系统测试(脱机) <linjimei@hotmail.com>

    右键单击以查看您可以与此人进行交流的方式。"

    Kbshortcut: [Error: getting string: hr=0x80004005 – 未指定的错误]

    DefAction: "双击"

    Parent: "":列表

    Help: none [nimpl]

    Help Topic: none [nimpl]

    ChildCount: 1

    Window: 0x00010210 class="MSBLWindowClass" style=0x16CF0000 ex=0x10108

    Children: "联系人卡片" : 按下按钮 : 正常

    Selection: none [nimpl]

    Ancestors: "" : 列表 : 正常

    "" : 窗口 : 正常

    "MSN Messenger" : 窗口 : 可调大小,可移动,可设定焦点

    "桌面" : 客户端 : 正常

    "桌面" : 窗口 : 正常

    [ No Parent ]

    /***************************************************************************

    do you have any suggestion for how I can get the Name and Description of a contact of MSN?

    or where I can find the resource about MSN accessibility? I searched from microsoft.com and

    google.com but I find nothing.

    thank you!

    Glant

  3. Glant says:

    sorry, as the blog system told me that my words can not be displayed correctly after I posted the first one,  so I posted it again. the second one can be removed.