1. Pau Haro
  2. PowerBuilder
  3. Monday, 23 November 2020 13:49 PM UTC

Hello everyone,

I need to show On-Screen Keyboard on my application, but (run("c:\windows\system32\osk.exe")) it's not working for me. If someone could tell me how to show it I'll be so grateful.

Accepted Answer
Pau Haro Accepted Answer Pending Moderation
  1. Tuesday, 24 November 2020 17:01 PM UTC
  2. PowerBuilder
  3. # Permalink

Hello everyone, 

To solve this issue, you can just add 2 files (OSKLauncher.exe & OSKLauncher64.exe) on your aplication folder, and run one of those files depeding on the architecture (64 or 32 bit) when you need to show the keyboard. Is this simple, this two files you can find it on your computer. I hope can help someone.

Regards.

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 24 November 2020 17:23 PM UTC
Thanks for sharing the solution!
  1. Helpful
  1. John Fauss
  2. Tuesday, 24 November 2020 17:25 PM UTC
That's great news, Pau. I appreciate you letting us know what worked for you!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 23 November 2020 22:43 PM UTC
  2. PowerBuilder
  3. # 1

The information contained within in the link that Govinda provided contains the answer, but you have to ferret it out.

In a quick test, I tried to execute the PowerScript command Run('C:\Windows\system32\osk.exe') and at runtime I get a "Could not start On-Screen Keyboard) message box. It fails because I'm running my test PB app from the IDE (therefore, it is a 32-bit process), and on my 64-bit Windows OS, the executables in the System32 folder are 64-bit.

When I change the command to 'C:\Windows\sysnative\osk.exe', the On-Screen Keyboard app opens and I can use it to send keystrokes to a DataWindow in my test app. The "sysnative" keyword is a virtual folder that signals windows to bypass file system redirection, so Windows looks (and executes) the osk.exe from the SysWOW64 folder, which is where the 32-bit version of system executables reside. Curiously, an attempt to run the osk.exe directly from the SysWOW64 folder fails. Oh, well. using "sysnative" appears to do the trick.

Please note that the "sysnative" alias should only be used from a 32-bit application. It should not be used from a 64-bit application.

HTH, John

Comment
  1. Pau Haro
  2. Tuesday, 24 November 2020 10:58 AM UTC
Hello John,



Im trying it but don't seems to work, I tried run('C:\Windows\sysnative\osk.exe') but It doesn't works, my application is 32 bit, and is not working on IDE runtime or deploy either. What im doing wrong?



Regards
  1. Helpful
  1. John Fauss
  2. Tuesday, 24 November 2020 14:21 PM UTC
I'm using PB 2017 R2, Windows 7 Ultimate and my ID has admin privileges. I did only what I described in the post. I do have access to a Windows 10 machine, but will not be able to test on it until I return home this evening. I'm not saying that running as Admin will solve the issue, but if your ID does not have administrator privileges, then I suggest you try that, as Chris suggested.
  1. Helpful
There are no comments made yet.
Mark Goldsmith Accepted Answer Pending Moderation
  1. Monday, 23 November 2020 19:47 PM UTC
  2. PowerBuilder
  3. # 2

Hi Pau,

I'm not certain but I think this may be a 32 bit versus 64 bit issue.  Try running OSK from the windows side-by-side folder (WinSxS) versus System32.

On my machine the full path would be: C:\Windows\WinSxS\amd64_microsoft-windows-osk_31bf3856ad364e35_10.0.19041.1_none_60ade0eff94c37fc\osk.exe but the folder name after WinSxS on yours may be slightly different.

HTH.

Regards...Mark

Comment
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Monday, 23 November 2020 17:12 PM UTC
  2. PowerBuilder
  3. # 3

Hi Pau,

 

Have you tried this: http://codeverge.com/embarcadero.delphi.nativeapi/osk.exe-on-a-w7-74bit-from-32-bi/2004568

 

It seems that this is a very common problem around software developers and that Microsoft tool. Try and see if that post provides a solution for you.

 

Regards,

Comment
  1. Pau Haro
  2. Tuesday, 24 November 2020 13:43 PM UTC
Hi Govinda,

Could you show me how to run (OSK) on any system (32 & 64 bit) I tried to (run('C:\Windows\sysnative\osk.exe')) but Run function returns -1. Need some help please.
  1. Helpful
  1. Govinda Lopez @Appeon
  2. Tuesday, 24 November 2020 15:55 PM UTC
Hi Pau,



This is a common problem for many software developers using this tool. You might want to try the system functions I shared to you through that link. Or perhaps you can try simulating the keystrokes to open the keyboard ( https://www.intowindows.com/6-ways-to-open-on-screen-keyboard-in-windows-10/ ).



If I find any workaround, I'll let you know.



Regards,
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 23 November 2020 16:48 PM UTC
  2. PowerBuilder
  3. # 4

Hi Pau;

   Since this is another App from the  "c:\windows\system32" folder ... does it work if you run your PB Calling App EXE "as Admin"?

Regards ... Chris

Comment
  1. Govinda Lopez @Appeon
  2. Monday, 23 November 2020 21:46 PM UTC
I've tried that. But with 32 and 64 bit applications it does not work. But this is not exclusive problem with PB. Rather it is a problem with the keyboard app.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.