Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/main.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/oleacc/oleacc.spec | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/dlls/oleacc/main.c b/dlls/oleacc/main.c index f6b66a8bcab..fd85518436c 100644 --- a/dlls/oleacc/main.c +++ b/dlls/oleacc/main.c @@ -331,6 +331,45 @@ HRESULT WINAPI AccessibleObjectFromPoint( POINT ptScreen, IAccessible** ppacc, V return E_NOTIMPL; }
+HRESULT WINAPI AccessibleObjectFromEvent( HWND hwnd, DWORD dwObjectID, DWORD dwChildID, + IAccessible** ppacc, VARIANT* pvarChild ) +{ + IDispatch *child; + VARIANT cid; + HRESULT hr; + + TRACE("%p %d %d %p %p\n", hwnd, dwObjectID, dwChildID, ppacc, pvarChild); + + hr = AccessibleObjectFromWindow(hwnd, dwObjectID, &IID_IAccessible, (void **)ppacc); + if (FAILED(hr)) + return hr; + + V_VT(&cid) = VT_I4; + V_I4(&cid) = dwChildID; + hr = IAccessible_get_accChild(*ppacc, cid, &child); + if (FAILED(hr)) + FIXME("get_accChild failed with %#x!\n", hr); + + V_VT(pvarChild) = VT_I4; + if (child) + { + IAccessible *acc; + + if (SUCCEEDED(IDispatch_QueryInterface(child, &IID_IAccessible, (void **)&acc))) + { + IAccessible_Release(*ppacc); + *ppacc = acc; + } + + IDispatch_Release(child); + V_I4(pvarChild) = CHILDID_SELF; + } + else + V_I4(pvarChild) = dwChildID; + + return S_OK; +} + HRESULT WINAPI AccessibleObjectFromWindow( HWND hwnd, DWORD dwObjectID, REFIID riid, void** ppvObject ) { diff --git a/dlls/oleacc/oleacc.spec b/dlls/oleacc/oleacc.spec index 4cff0b8effc..9ad6e915965 100644 --- a/dlls/oleacc/oleacc.spec +++ b/dlls/oleacc/oleacc.spec @@ -1,5 +1,5 @@ @ stdcall AccessibleChildren(ptr long long ptr ptr) -@ stub AccessibleObjectFromEvent +@ stdcall AccessibleObjectFromEvent(ptr long long ptr ptr) @ stdcall AccessibleObjectFromPoint(int64 ptr ptr) @ stdcall AccessibleObjectFromWindow(ptr long ptr ptr) @ stdcall CreateStdAccessibleObject(ptr long ptr ptr)