c ++获取其他Windows消息 [英] c++ get other windows messages

查看:232
本文介绍了c ++获取其他Windows消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

im学习使事情到其他窗口,如调整大小ie或任何类型的窗口。唯一的问题,我不知道我可以得到或给其他窗口的消息。

所以像我按下一个键,即我想得到该消息我的程序太!

任何想法

解决方案

要获取发送到Windows程序的消息,您必须安装一个钩子才能收听到您想要的邮件。您可以通过 SetWindowsHookEx 功能执行此操作。 / p>

但是,我相信你应该阅读一本关于这种行为的书,因为你必须应用一些规则。例如,在从您的回调函数返回之前,您必须调用 CallNextHookEx ,以便让其他钩子处理消息。 这是books.google.com在搜索setwindowshookex时的第一次匹配。 >

im learning to make things to other windows like resize the ie or any type of window. the only problem i don't know how i can get or give messages to other windows.
so like i pressed a key in ie i would like to get that message to my program too!
any idea

解决方案

To get the messages that are sent to windows programs you have to install a hook in order to listen to the messages you want. You do this via the SetWindowsHookEx function.

However, I believe that you should read a book about this kind of behaviour, since there are certain rules you have to apply. For instance, before returning from your callback function, you have to call CallNextHookEx in order to let the other hooks handle the message. This is the first hit in books.google.com when searching for setwindowshookex.

这篇关于c ++获取其他Windows消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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