From b8d0118517e8a42a7987dc7cdc61e1a7a59f9578 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 27 Sep 2021 16:11:20 +0200 Subject: [PATCH] oleacc: Add put_accValue function for edit client accessible object. Signed-off-by: Connor McAdams Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/oleacc/client.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 1dd18240179..192a006bdba 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -48,6 +48,7 @@ struct win_class_vtbl { HRESULT (*get_name)(Client*, VARIANT, BSTR*); HRESULT (*get_kbd_shortcut)(Client*, VARIANT, BSTR*); HRESULT (*get_value)(Client*, VARIANT, BSTR*); + HRESULT (*put_value)(Client*, VARIANT, BSTR); }; static HRESULT win_get_name(HWND hwnd, BSTR *name) @@ -493,6 +494,9 @@ static HRESULT WINAPI Client_put_accValue(IAccessible *iface, VARIANT id, BSTR v TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&id), value); + if(This->vtbl && This->vtbl->put_value) + return This->vtbl->put_value(This, id, value); + if(convert_child_id(&id) != CHILDID_SELF) return E_INVALIDARG; return S_FALSE; @@ -800,12 +804,22 @@ static HRESULT edit_get_value(Client *client, VARIANT id, BSTR *value_out) return S_OK; } +static HRESULT edit_put_value(Client *client, VARIANT id, BSTR value) +{ + if(convert_child_id(&id) != CHILDID_SELF || !IsWindow(client->hwnd)) + return E_INVALIDARG; + + SendMessageW(client->hwnd, WM_SETTEXT, 0, (LPARAM)value); + return S_OK; +} + static const win_class_vtbl edit_vtbl = { edit_init, edit_get_state, edit_get_name, edit_get_kbd_shortcut, edit_get_value, + edit_put_value, }; static const struct win_class_data classes[] = {