Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger Cortana Programmatically?

Is there a way to use VoiceCommand methods used to programaticlly trigger Cortana as if the Cortana has registered "Hey Cortana" to begin listening?

like image 461
jerryh91 Avatar asked Sep 10 '26 05:09

jerryh91


1 Answers

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);
like image 85
natidea Avatar answered Sep 12 '26 21:09

natidea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!