From 817222558d3e3dd09aba1f348f24eda22a32190b Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 28 Apr 2014 17:30:31 +0200 Subject: [PATCH] oleacc: Add AccessibleObjectFromWindow implementation. --- dlls/oleacc/main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/oleacc/main.c b/dlls/oleacc/main.c index 5a7afd906c5..c1e2bf82d18 100644 --- a/dlls/oleacc/main.c +++ b/dlls/oleacc/main.c @@ -217,9 +217,24 @@ HRESULT WINAPI AccessibleObjectFromPoint( POINT ptScreen, IAccessible** ppacc, V HRESULT WINAPI AccessibleObjectFromWindow( HWND hwnd, DWORD dwObjectID, REFIID riid, void** ppvObject ) { - FIXME("%p %d %s %p\n", hwnd, dwObjectID, + TRACE("%p %d %s %p\n", hwnd, dwObjectID, debugstr_guid( riid ), ppvObject ); - return E_NOTIMPL; + + if(!ppvObject) + return E_INVALIDARG; + *ppvObject = NULL; + + if(IsWindow(hwnd)) { + LRESULT lres; + + lres = SendMessageW(hwnd, WM_GETOBJECT, 0xffffffff, dwObjectID); + if(FAILED(lres)) + return lres; + else if(lres) + return ObjectFromLresult(lres, riid, 0, ppvObject); + } + + return CreateStdAccessibleObject(hwnd, dwObjectID, riid, ppvObject); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,