如何从另一个应用程序中查找输入框句柄 [英] How to find a input box handle from another application

查看:70
本文介绍了如何从另一个应用程序中查找输入框句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一种简单的输入方法,要求是:当其他应用程序中的某个输入框出现时,我的输入应用程序应该显示出来,而输入隐藏后就隐藏了.

现在,我设置了一个计时器来检测何时应该显示我的窗口,因此我需要检测其他应用程序的输入框窗口句柄,如果它是有效的句柄,那么我将显示我的输入法.但不幸的是,我不知道该怎么办.有人可以帮助我吗?非常感谢.

我尝试使用GetForegroundInfo获取前景窗口句柄和焦点窗口句柄,但是无论是否需要输入,它总是返回有效值.

Hello all,

I am developing a simple input method, the requirement is: when some input box in other application, then my input application should show out and after input hide by itself.

Now i set a timer to detect when i should show my window out, so i need to detect the input box window handle of other application, if it is a valid handle, then i will show my input method out. But unfortunately, i don''t know to do. Do anybody can help me? thanks very much.

i tried GetForegroundInfo to get the foreground window handle and the focus window handle, but it always return valid value whatever it need input or not.

推荐答案

所有Windows都有句柄,因此,您需要有关要搜索的窗口类型的更多信息.同样从您的问题出发,如果您的应用程序依赖计时器,那么您将错过很多输入.您可能需要研究挂钩 [ ^ ].
All Windows have handles, so you need to have some more information about the type of window you are searching for. Also from your question you are going to miss lots of input if your application relies on a timer. You probably need to look into the use of hooks[^].


感谢里查德,

我想我必须放弃这种方法,因为我不知道要搜索的窗口类型.

随便,谢谢您的回复.
Thanks Richiard,

I think I have to give up this method as i don''t know the type of window i am searching for.

whatever, thanks for your reply.


这篇关于如何从另一个应用程序中查找输入框句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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