How to raise the on-screen keyboard using C ++ on Windows 7 tablet devices?

I am developing an application for Windows 7 devices and I am using the built-in web browser (webkit). Typically, touching an edit control on a tablet device will cause a small keyboard to appear. However, since my edit control is in a browser, this is not a real window with hwnd, and Window does not display an icon that you can click to open the on-screen keyboard.

Is there an API that I can use to invoke the small keyboard icon, as usual, when the focus moves to the edit control?

  • I tried searching on MSDN, without success.
  • I looked at the Windows API. No dice.
  • I tried to run OSK.exe. This can lead to multiple keyboard instances, and it's just messy. I want to get the same effect that the user will get when they click on the window editing control, so the user interface will be consistent.

There must be an API that can call this on the on-screen keyboard.

Thanks.

David

+1
source share
1 answer

Not sure if you have already answered. I looked at a similar thing, although this is part of a large application, and the keyboard is rarely used (but nevertheless had to be supported). I assigned a shortcut key (right-click Win 7 on the on-screen keyboard application and select β€œProperties.” On the shortcut tab, assign any shortcut you want). When I touch the SurfaceTextEdit control, I emulate a shortcut from my C ++ code using SendInput (). I know this is a hack, but it worked for me because I rarely used the on-screen keyboard in my application.

0
source

Source: https://habr.com/ru/post/1484225/


All Articles