22

I am creating a windows application using C#, where in a button on the GUI when clicked, should display the on-screen keyboard.

Would appreciate if any help is granted. thanks.

Also, since I am mostly using Emgu Cv library for the rest of my app, Can we simply use it for calling the On-screen keyboard?

ykombinator
  • 2,724
  • 7
  • 25
  • 46

2 Answers2

34

In C#, you can simply write the following line of code to invoke the on-screen keyboard application that comes with Windows:

System.Diagnostics.Process.Start("osk.exe");

You can find more help here.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Jits
  • 712
  • 7
  • 11
  • I just tried it in win10 (creators update) and it works – Lyra May 31 '17 at 14:29
  • 3
    On Windows 10 you need to change Build settings to perform target in x64 like @Hassan Rahman said – john.kernel Jun 28 '18 at 07:23
  • The solution in this link worked for me: https://stackoverflow.com/questions/2929255/unable-to-launch-onscreen-keyboard-osk-exe-from-a-32-bit-process-on-win7-x64 – Ali Majed HA Aug 27 '23 at 16:32
14

For Windows 10 x64, You have set the project build to x64 as shown in image.

enter image description here

Process process = Process.Start(new ProcessStartInfo(
            ((Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe"))));
Hassan Rahman
  • 4,953
  • 1
  • 34
  • 32