简体   繁体   中英

Any way to get notified when a inputable box is actived in windows

In Android/IOS os, once a inputable box is clicked, the input method will be invoked automatically.

Now I have a similar demand on Windows os. We want to get the event when any inputable-box is clicked. I have investigated some softwares which own this function and they can work well most of the time execept it may miss rest of the time but which we can tolerate.

I have tried some method. Such as using spy++ to watch the event generated when a inputable-box is clicked, but i cannot find any clue.

Then i try to hook some API about IME followed: ImmGetCompositionFontW ImmAssociateContextEx

ImmGetCompositionFontW works well most of time, but it has seriously False Positives.

I think the key is still to hook, but i cannot decide which api to hook

can anyone help me? PS: forgive my poor English.

In Windows, an "inputable box" will normally be something like an edit control or possibly a Rich text control.

In any case, it will normally be a window of some sort, and in Windows, when a window receives the "input focus", its owning code will receive a WM_SETFOCUS message. So, if you need to do something when a particular control receives input focus, you'll normally want to handle WM_SETFOCUS for that control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM