如何在 Windows 7 平板设备中使用 C++ 调出屏幕键盘?

编程入门 行业动态 更新时间:2024-10-07 05:27:29
本文介绍了如何在 Windows 7 平板设备中使用 C++ 调出屏幕键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在开发适用于 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屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 11:17:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408580.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平板   键盘   屏幕   设备   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!