如何在 Windows 7 平板设备中使用 C++ 调出屏幕键盘? [英] How to bring up the on screen keyboard using C++ in Windows 7 tablet devices?

查看:54
本文介绍了如何在 Windows 7 平板设备中使用 C++ 调出屏幕键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发适用于 Windows 7 设备的应用程序,并且正在使用嵌入式 Web 浏览器 (webkit).通常触摸平板设备上的编辑控件会导致出现一个小键盘图标.但是,由于我的编辑控件位于浏览器中,因此它不是带有 hwnd 的真实窗口,并且 Window 不会显示您可以单击以显示屏幕键盘的图标.

I am developing an application for Windows 7 devices and I'm using an embedded web browser (webkit). Normally touching an edit control on a tablet device causes a little keyboard icon to appear. However, since my edit control is in the browser, it's not a real window with an hwnd and Window's doesn't bring up the icon you can click on to bring up the on screen keyboard.

是否可以使用 API 使小键盘图标在焦点转到编辑控件时正常显示?

Is there an API I can use to cause the little keyboard icon to appear as it normally would when focus goes to an edit control?

  • 我尝试搜索 MSDN,但没有成功.
  • 我查看了 Windows 键盘 API.没有骰子.
  • 我尝试运行 OSK.exe.这可能会出现键盘的多个实例,而且它很草率.我希望获得与用户在点击 Windows 编辑控件时获得的效果相同的效果,以便 UI 保持一致.

必须有一个可以在屏幕键盘上显示的 API.

There must be an API that can bring up that on screen keyboard.

谢谢.

大卫

推荐答案

不确定您是否已经回答了这个问题.我一直在考虑做类似的事情,尽管它是更大应用程序的一部分,并且很少使用键盘(但必须支持).我分配了一个快捷键(在屏幕键盘应用程序上右键单击 Win 7 并选择属性.在快捷方式选项卡中,分配您想要的任何快捷方式).当我触摸 SurfaceTextEdit 控件时,我使用 SendInput() 从我的 C++ 代码中模拟快捷键.我知道这是一个 hack,但它对我来说效果很好,因为我很少在我的应用程序中使用屏幕键盘.

Not sure if you have this answered already. I have been looking at doing a similar thing although it is a part of a larger application and the keyboard is rarely used (but nevertheless had to be supported). I assigned a shortcut key (right click Win 7 on screen keyboard application and choose Properties. In the shortcut tab, assign any shortcut you'd like). When I touch a SurfaceTextEdit control, I emulate the shortcut key from my C++ code using SendInput(). I know this is a hack, but it worked well for me because I rarely used the onscreen keyboard in my application.

这篇关于如何在 Windows 7 平板设备中使用 C++ 调出屏幕键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆