Enabling the Windows 10 dictation toolbar programmatically?

329 Views Asked by At

Is it possible to activate the new dictation toolbar (the one available since W10 Falls Creators Update) programmatically? I'd like to use dictation in a C# winforms app, but I don't want the user to use windows key+H, I want to activate the dictation toolbar from a button or depending on the context, I don't seem to find an API for that. Per se, dictation works everywhere, even non .net old win32 programs.

1

There are 1 best solutions below

0
Chris Taylor On

One option would be to simulate the key press for WIN+H. You can use the InputSimulator nuget package.

InputSimulator input = new InputSimulator();
input.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_H);

The process that is started is 'WindowsInternal.ComposableShell.Experiences.TextInput.InputApp.exe', which you can programmatically start using the registered protocol handler 'ms-inputapp'. But this will not show the UI, it will just start the application if it is not running. This is probably not necessary, since using the hotkey will launch the application if it is not already running, but I wanted to mention this just incase it gives you some additional results when you research this topic.