0

I have a fullscreen C# .NET application I need to be able to call the On-Screen-Keyboard. In Windows 7, I used: Process.Start(C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe;

With older builds of Windows 10, I was able to use Process process = Process.Start(new ProcessStartInfo(((Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe")))); (This gets the System32 location and appends the executable name.)

That worked until recently.

However now the executable is in C:\Windows\WinSxS\amd64_microsoft-windows-osk_31bf3856ad364e35_10.0.17134.1_none_903d5fc3c319176b\osk.exe So my question is, is there a reliable way to call the on-screen-keyboard that will work for the foreseeable future?

Also I'd be interested in using the touch keyboard but that's also in an odd location- C:\Windows\WinSxS\amd64_microsoft-windows-tabletpc-inputpanel_31bf3856ad364e35_10.0.17134.1_none_f70fa21de0acb308\TabTip.exe The second windows does an update and that version updates in the folder path, a static reference to the folder becomes worthless.

Charles Iams
  • 66
  • 1
  • 1
  • 8

1 Answers1

1

If on-screen keyboard is in your environment variables (which is there by default) this code should work just fine:

Process.Start("osk.exe");

Boxed
  • 186
  • 1
  • 11
  • Odd.. Running osk.exe from Run opens the keyboard, however running the same thing using Process.Start gives me `The system cannot find the file specified`. I tried creating a ProcessStartInfo object and assigning the file name there and starting it, with the debugger I was able to confirm the path is loading from the system environment yet still shows the same error. – Charles Iams Jul 31 '18 at 12:44
  • @CharlesIams not sure if this'll will work for you but check in your project's properties in the Build tab if Prefer 32-Bit is ticked/checked. Un-tick/Un-check it or force it to x64 platform target and see if `Process.Start("osk");` will still throw an error. – Boxed Jul 31 '18 at 15:01