oleacc: Add Client_get_accName implementation.

This commit is contained in:
Piotr Caban 2014-05-01 16:14:24 +02:00 committed by Alexandre Julliard
parent 99d0590b01
commit a5f78530dd
4 changed files with 36 additions and 3 deletions

View File

@ -1,6 +1,6 @@
MODULE = oleacc.dll
IMPORTLIB = oleacc
IMPORTS = ole32 user32 uuid
IMPORTS = uuid oleaut32 ole32 user32
C_SRCS = \
client.c \

View File

@ -142,8 +142,29 @@ static HRESULT WINAPI Client_get_accChild(IAccessible *iface,
static HRESULT WINAPI Client_get_accName(IAccessible *iface, VARIANT varID, BSTR *pszName)
{
Client *This = impl_from_Client(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszName);
return E_NOTIMPL;
WCHAR name[1024];
UINT i, len;
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszName);
*pszName = NULL;
if(convert_child_id(&varID) != CHILDID_SELF || !IsWindow(This->hwnd))
return E_INVALIDARG;
len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name);
if(!len)
return S_FALSE;
for(i=0; i<len; i++) {
if(name[i] == '&') {
len--;
memmove(name+i, name+i+1, (len-i)*sizeof(WCHAR));
break;
}
}
*pszName = SysAllocStringLen(name, len);
return *pszName ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI Client_get_accValue(IAccessible *iface, VARIANT varID, BSTR *pszValue)

View File

@ -70,6 +70,17 @@ const char *debugstr_variant(const VARIANT *v)
}
}
int convert_child_id(VARIANT *v)
{
switch(V_VT(v)) {
case VT_I4:
return V_I4(v);
default:
FIXME("unhandled child ID variant type: %d\n", V_VT(v));
return -1;
}
}
HRESULT WINAPI CreateStdAccessibleObject( HWND hwnd, LONG idObject,
REFIID riidInterface, void** ppvObject )
{

View File

@ -21,6 +21,7 @@
HRESULT create_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
int convert_child_id(VARIANT *v) DECLSPEC_HIDDEN;
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
{