How do you show/hide the Dictation Toolbar from C#

250 views Asked by At

I'm trying to show/hide the dictation toolbar, I don't want to simply simulate WIN + H command. I'm not too familiar with UWP but it looks like the Dictation Toolbar is part of ms-inputapp (InputHostApp.exe). Is there a way to figure out the command that WIN + H is executing to show the dictation toolbar?

1

There are 1 answers

1
torvin On

Not really an answer, but this is as far as I could get. Might be helpful for somebody.

This is the call stack in explorer.exe processing Win+H hotkey (Windows 10 v19041.508):

coreuicomponents.Microsoft::CoreUI::Proxy::MessageProxy::Send+119
coreuicomponents.public: virtual void __cdecl Proxy_IRemoteCoreKeyboardClient$R::IRemoteCoreKeyboardClient_Impl::OnShellStateChanged(class System::Object * __ptr64,class System::Byte_1D * __ptr64,unsigned int,bool,bool,unsigned int,unsigned int) __ptr64+7E
coreuicomponents.public: void __cdecl IRemoteCoreKeyboardClient::OnShellStateChanged(class System::Byte_1D * __ptr64,unsigned int,bool,bool,unsigned int,unsigned int) __ptr64+66
coreuicomponents.public: virtual long __cdecl IRemoteCoreKeyboardClient$X__ExportAdapter::OnShellStateChanged(struct MsgBlob * __ptr64,unsigned int,bool,bool,unsigned int,unsigned int) __ptr64+BC
windows.ui.core.textinput.public: virtual long __cdecl CCoreKeyboardManager::ShellStateChanged(struct Windows::Foundation::Collections::IVectorView<struct Windows::UI::Internal::Text::Core::CoreKeyboardPositionAndSizeOption> * __ptr64,enum Windows::UI::Internal::Text::Core::CoreKe
twinui.pcshell.private: long __cdecl KeyboardHosting::TabTipAdapter::ProcessShowRequest(enum Windows::UI::Internal::Text::Core::CoreKeyboardViewType) __ptr64+11F
twinui.pcshell.private: long __cdecl KeyboardHosting::TabTipAdapter::OnShellRequestedStateChange(enum Windows::UI::Internal::Text::Core::CoreKeyboardViewType,enum Windows::UI::Internal::Text::Core::CoreKeyboardModality,enum KeyboardHosting::ShellRequestedStateChangeReas
twinui.pcshell.public: long __cdecl KeyboardHosting::TabTipAdapter::OnShellHotKey(enum _TouchKeyboardShellHotKeyType) __ptr64+1E2
twinui.pcshell.public: virtual long __cdecl TouchKeyboardExperienceManager::OnShellHotKey(enum _TouchKeyboardShellHotKeyType) __ptr64+17
explorer.protected: void __cdecl CTray::_HandleDictationHotKey(void) __ptr64+67
explorer.protected: void __cdecl CTray::_HandleGlobalHotkey(unsigned __int64,__int64) __ptr64+417
explorer.protected: virtual __int64 __cdecl CTray::v_WndProc(struct HWND__ * __ptr64,unsigned int,unsigned __int64,__int64) __ptr64+48F

TouchKeyboardExperienceManager::OnShellHotKey() is called with a value 2 which probably means Win+H

_HandleDictationHotKey calls TouchKeyboardExperienceManager::OnShellHotKey via something COM-like using IID_ITouchKeyboardExperienceManager = 9516d866-ca0f-40ca-8997-efa618b50f99, but I couldn't find any calls to CoCreateInstance or anything similar.

It appears to eventually send the message to touch keyboard via some kind of RPC (Microsoft::CoreUI::Proxy::MessageProxy::Send)