Is there a way to use VoiceCommand methods used to programaticlly trigger Cortana as if the Cortana has registered "Hey Cortana" to begin listening?
I had this same question, but for Windows 10. Found a solution: on Windows 10, you can trigger Cortana with Win + C key stroke combination. To get this working programmatically, you would need interop with the Win32 SendInput method. Fortunately there is a NuGet package Windows Input Simulator, that does just this:
Install-Package InputSimulator
With that installed I was able to trigger Cortana from a WPF app using:
var sim = new InputSimulator();
sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_C);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With