Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/client.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 0c2215fe62e..38611520b38 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -303,11 +303,35 @@ static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface, return S_OK; }
-static HRESULT WINAPI Client_get_accFocus(IAccessible *iface, VARIANT *pvarID) +static HRESULT WINAPI Client_get_accFocus(IAccessible *iface, VARIANT *focus) { Client *This = impl_from_Client(iface); - FIXME("(%p)->(%p)\n", This, pvarID); - return E_NOTIMPL; + GUITHREADINFO info; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, focus); + + V_VT(focus) = VT_EMPTY; + info.cbSize = sizeof(info); + if(GetGUIThreadInfo(0, &info) && info.hwndFocus) { + if(info.hwndFocus == This->hwnd) { + V_VT(focus) = VT_I4; + V_I4(focus) = CHILDID_SELF; + } + else if(IsChild(This->hwnd, info.hwndFocus)) { + IDispatch *disp; + + hr = AccessibleObjectFromWindow(info.hwndFocus, OBJID_WINDOW, + &IID_IDispatch, (void**)&disp); + if(FAILED(hr)) return hr; + if(!disp) return E_FAIL; + + V_VT(focus) = VT_DISPATCH; + V_DISPATCH(focus) = disp; + } + } + + return S_OK; }
static HRESULT WINAPI Client_get_accSelection(IAccessible *iface, VARIANT *pvarID)