diff --git a/dlls/windows.ui.core.textinput/Makefile.in b/dlls/windows.ui.core.textinput/Makefile.in index 38d07a5a5c0b..168ebcc21cad 100644 --- a/dlls/windows.ui.core.textinput/Makefile.in +++ b/dlls/windows.ui.core.textinput/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.ui.core.textinput.dll -IMPORTS = combase +IMPORTS = combase user32 SOURCES = \ classes.idl \ diff --git a/dlls/windows.ui.core.textinput/main.c b/dlls/windows.ui.core.textinput/main.c index 25110e09be9f..57aeef9c2456 100644 --- a/dlls/windows.ui.core.textinput/main.c +++ b/dlls/windows.ui.core.textinput/main.c @@ -23,6 +23,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(coreinputview); +#define WM_TABTIP_OSK_TOGGLE (WM_USER + 1) + struct core_input_view { ICoreInputView ICoreInputView_iface; @@ -30,6 +32,7 @@ struct core_input_view ICoreInputView3 ICoreInputView3_iface; ICoreInputView4 ICoreInputView4_iface; struct weak_reference_source weak_reference_source; + HWND tabtip_hwnd; }; static inline struct core_input_view *impl_from_ICoreInputView(ICoreInputView *iface) @@ -159,14 +162,28 @@ static HRESULT WINAPI core_input_view_GetCoreInputViewOcclusions(ICoreInputView static HRESULT WINAPI core_input_view_TryShowPrimaryView(ICoreInputView *iface, boolean *result) { - FIXME("iface %p, boolean %p stub!\n", iface, result); - return E_NOTIMPL; + struct core_input_view *impl = impl_from_ICoreInputView(iface); + + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view_TryHidePrimaryView(ICoreInputView *iface, boolean *result) { - FIXME("iface %p, boolean %p stub!\n", iface, result); - return E_NOTIMPL; + struct core_input_view *impl = impl_from_ICoreInputView(iface); + + FIXME("iface %p, boolean %p semi-stub!\n", iface, result); + + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, FALSE, 0); + + *result = TRUE; + return S_OK; } static const struct ICoreInputViewVtbl core_input_view_vtbl = @@ -249,22 +266,43 @@ DEFINE_IINSPECTABLE(core_input_view3, ICoreInputView3, struct core_input_view, I static HRESULT WINAPI core_input_view3_TryShow(ICoreInputView3 *iface, boolean *result) { - FIXME("iface %p, result %p stub!\n", iface, result); - return E_NOTIMPL; + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + + FIXME("iface %p, result %p semi-stub!\n", iface, result); + + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view3_TryShowWithKind(ICoreInputView3 *iface, CoreInputViewKind type, boolean *result) { - FIXME("iface %p, type %d, result %p stub!\n", iface, type, result); - return E_NOTIMPL; + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + + FIXME("iface %p, type %d, result %p semi-stub!\n", iface, type, result); + + if (impl->tabtip_hwnd && (type == CoreInputViewKind_Default || type == CoreInputViewKind_Keyboard)) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + + *result = FALSE; + return S_OK; } static HRESULT WINAPI core_input_view3_TryHide(ICoreInputView3 *iface, boolean *result) { - FIXME("iface %p, result %p stub!\n", iface, result); - return E_NOTIMPL; + struct core_input_view *impl = impl_from_ICoreInputView3(iface); + + FIXME("iface %p, result %p semi-stub!\n", iface, result); + + if (impl->tabtip_hwnd) + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, FALSE, 0); + + *result = TRUE; + return S_OK; } static const struct ICoreInputView3Vtbl core_input_view3_vtbl = @@ -443,6 +481,7 @@ static HRESULT WINAPI core_input_view_statics_GetForCurrentView(ICoreInputViewSt view->ICoreInputView2_iface.lpVtbl = &core_input_view2_vtbl; view->ICoreInputView3_iface.lpVtbl = &core_input_view3_vtbl; view->ICoreInputView4_iface.lpVtbl = &core_input_view4_vtbl; + view->tabtip_hwnd = FindWindowW(L"IPTip_Main_Window", L"Input"); if (FAILED(hr = weak_reference_source_init(&view->weak_reference_source, (IUnknown *)&view->ICoreInputView_iface))) diff --git a/dlls/windows.ui.core.textinput/private.h b/dlls/windows.ui.core.textinput/private.h index 8b9e6419410f..80aaca727df6 100644 --- a/dlls/windows.ui.core.textinput/private.h +++ b/dlls/windows.ui.core.textinput/private.h @@ -23,6 +23,7 @@ #define COBJMACROS #include "windef.h" #include "winbase.h" +#include "winuser.h" #include "winstring.h" #include "activation.h" #include "wine/debug.h"