Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/client.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 0c2215fe62e..4c6dc0ab18b 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -306,8 +306,26 @@ static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface, static HRESULT WINAPI Client_get_accFocus(IAccessible *iface, VARIANT *pvarID) { Client *This = impl_from_Client(iface); - FIXME("(%p)->(%p)\n", This, pvarID); - return E_NOTIMPL; + GUITHREADINFO info; + + TRACE("(%p)->(%p)\n", This, pvarID); + + V_VT(pvarID) = VT_EMPTY; + info.cbSize = sizeof(info); + if(GetGUIThreadInfo(0, &info) && info.hwndFocus) { + if(info.hwndFocus == This->hwnd) { + V_VT(pvarID) = VT_I4; + V_I4(pvarID) = CHILDID_SELF; + } + else if(IsChild(This->hwnd, info.hwndFocus)) { + V_VT(pvarID) = VT_DISPATCH; + if(FAILED(AccessibleObjectFromWindow(info.hwndFocus, OBJID_WINDOW, + &IID_IDispatch, (void**)&V_DISPATCH(pvarID)))) + V_VT(pvarID) = VT_EMPTY; + } + } + + return S_OK; }
static HRESULT WINAPI Client_get_accSelection(IAccessible *iface, VARIANT *pvarID)