MSAA COM-based?

三世轮回 提交于 2019-12-08 07:32:41

问题


I'm wondering if MSAA is COM-based, then one should be able to use CreateObject("Accessibility") to create an instance and call its methods. I had no success doing that. I have "OLEACC.DLL" in SYSTEM32 and it's registered with Windows. But the CreateObject fails.

Any thoughts?

I would like to use functions like AccessibleObjectFromPoint() to get the IAccessible object of the control at the given point.

Has anybody had such an experience?

Any input would be highly appreciated,

Thanks,

Kamil


回答1:


MSAA is COM based. However, there is no co-creatable class exposed, it exposes only interfaces. That's the reason you can't do CreateObject().

The MSAA-exposed APIs, like AccessibleObjectFromPoint and AccessibleObjectFromWindow are dll-exported C++ methods. You can use them from C++ by linking the proper lib or doing LoadLibrary/GetProcAddress with the function name. From C#, you can get the P/nvoke declaration for these from Pinvoke.net. For example, here's the DllImport for AccessibleObjectFromWindow.



来源:https://stackoverflow.com/questions/1904402/msaa-com-based

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!