0

I am trying to programmatically open the windows 7 on screen keyboard (osk.exe) from my program. I found a good guide for this on this page and it works quite well when UAC is turned off.

When UAC is turned on, it is not opening the program at all however, and I can't find why. No UAC prompt is shown when opening the keyboard from the start menu, so it doesn't appear to need administrative privileges.

Is it just because the executable is located in the windows system folder, and if so, is there another way to launch a program that would work?

The error returned is 3, ERROR_PATH_NOT_FOUND, possibly because 'sysnative' path is not working with UAC enabled.

Trying to run "osk.exe" without path also fails, with an error "Could not start the On Screen Keyboard"

Finally, running "C:\Windows\system32\osk.exe" fails with error code 5: SE_ERR_ACCESSDENIED when I tried to use it with redirection turned off (as suggested in this question)

Community
  • 1
  • 1
Adion
  • 579
  • 1
  • 9
  • 21
  • What does the call to `ShellExecute` return? It will give you an error code if it fails http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx – shf301 Feb 02 '13 at 16:42
  • The error is 3, ERROR_PATH_NOT_FOUND, as the comment below also said – Adion Feb 03 '13 at 12:24

1 Answers1

0

I tested the c++ code sample you refer to in your message. The routine started either from VS devenv or as a standalone exe did always show the on-screen keyboard under any available UAC mode. My OS: Windows 7 Ult. SP1 64-bit.

user2529145
  • 265
  • 3
  • 5