捕获聚焦窗的手柄? [英] Capturing handle of focusing window?

查看:77
本文介绍了捕获聚焦窗的手柄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我想编写一个可以获取一些聚焦窗口的MFC应用程序.例如:如果我的程序正在运行并且您正在与某人聊天,则我的程序可以控制聊天窗口.你能帮助我吗?非常感谢!

Hi, everybody!
I want to code a MFC application which can get some focusing windows. Ex: if my program is running and you are chatting with someone, my program can get control of the chatting window. Can you help me? Thanks so much!

推荐答案

使用带有WH_CBT参数的SetWindowsHookEx创建一个全局CBT挂钩.现在,当窗口即将成为焦点时,您的代码将得到通知.
Create a global CBT hook using the SetWindowsHookEx with the WH_CBT parameter. You''re code will now get notification when a window is about to get the focus.


这篇关于捕获聚焦窗的手柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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