Letting a Window believe it is still in focus although it is not

南笙酒味 提交于 2021-02-07 04:13:42

问题


I have to deal with a nasty MS Windows application that quits doing its job as soon as it loses focus. My question is, how can I trick this application somehow to believe that it is still in focus, although it really is not?

My thoughts are:

  1. Is it possible to suppress the corresponding "WM" message from just this application?
  2. Can I send a fake message to this window that it acts like it is in focus?

回答1:


Sending the WM_ACTIVATE message works for some apps:

 SendMessage(hWnd, WM_ACTIVATE, WA_CLICKACTIVE, hWnd);

Leaving the last parameter as NULL might work too.



来源:https://stackoverflow.com/questions/13843742/letting-a-window-believe-it-is-still-in-focus-although-it-is-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!