From f196551a4d465f726f19ecbc4e74a22d9ee51975 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 1 May 2014 16:14:58 +0200 Subject: [PATCH] oleacc: Add Client_get_accHelpTopic implementation. --- dlls/oleacc/client.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 88009f3ef0b..a60ec24420c 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -238,9 +238,31 @@ static HRESULT WINAPI Client_get_accHelpTopic(IAccessible *iface, static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface, VARIANT varID, BSTR *pszKeyboardShortcut) { + static const WCHAR shortcut_fmt[] = {'A','l','t','+','!',0}; Client *This = impl_from_Client(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszKeyboardShortcut); - return E_NOTIMPL; + WCHAR name[1024]; + UINT i, len; + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszKeyboardShortcut); + + *pszKeyboardShortcut = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + + len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name); + for(i=0; i= len) + return S_FALSE; + + *pszKeyboardShortcut = SysAllocString(shortcut_fmt); + if(!*pszKeyboardShortcut) + return E_OUTOFMEMORY; + + (*pszKeyboardShortcut)[4] = name[i+1]; + return S_OK; } static HRESULT WINAPI Client_get_accFocus(IAccessible *iface, VARIANT *pvarID)