简体   繁体   English

当窗口用户将焦点输入到输入区域时如何响应事件?

[英]How to react event when window user enter focus into an input area?

I'm going to implementing an On Screen Keyboard for Window which requires the OSK app to show when an user enter an input area. 我将实现用于Windows的屏幕键盘,该键盘要求OSK应用程序在用户输入输入区域时显示。 For example, when a user open notepad.exe and start clicking on it, my OSK app (currently run in system tray) should be showed. 例如,当用户打开notepad.exe并开始单击它时,应显示我的OSK应用程序(当前在系统托盘中运行)。

I have no idea how to catch those event (user click on notepad app) but I guess it relates to the Win32 things. 我不知道如何捕获这些事件(用户在记事本应用程序上单击),但是我想它与Win32有关。 Can anybody give me a hint for this ? 有人可以给我一个提示吗? Would be highly appreciated. 将不胜感激。

Thanks 谢谢

You'll probably have to set a global hook , using eg SetWindowsHookEx() , in order to monitor the WM_SETFOCUS messages sent to all the edit controls in all the applications. 为了监视发送到所有应用程序中所有编辑控件的WM_SETFOCUS消息,可能必须使用例如SetWindowsHookEx()来设置全局挂钩

That's quite intrusive, and that won't be easy. 那是很麻烦的,而且不容易。 Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在获取用户输入时限制数字数量以及如何自动按 Enter - how to limit digit amount when getting user input and how to automatically press enter 如何使用户必须输入一个窗口? - How do I make a window compulsory for the user to enter some information? 如何限制用户可以在控制台中输入的输入长度? - How can I limit the length of input that user can enter in the console? 弹出窗口时如何保持文本框的焦点 - How to keep text box's focus when a window pops up 如何在窗口失焦或调整大小时停止暂停OpenGL? - How to stop OpenGL from pausing when the window is out of focus or resizing? 要求用户在命令窗口中输入用户名 - Ask user to enter username in a command window 如何通过批处理文件中的用户输入在mysql连接中输入用户名,密码,数据库名 - how to enter user name , password , db name , in mysql connection by user input in batch file 无需按回车键即可获取用户输入 - Get user input without pressing enter 在Python 3中获取用户输入,而无需按Enter - Get user input in Python 3 without pressing enter 窗口设置为不活动,文本框窗口无法获得焦点,无法输入文本 - The window is set to not active, the text box window can not get the focus and can not enter text
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM