c++ get other windows messages

前端 未结 2 623
名媛妹妹
名媛妹妹 2020-12-22 07:33

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

相关标签:
2条回答
  • 2020-12-22 07:47

    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.

    0 讨论(0)
  • 2020-12-22 08:04

    Normally your application won't receive Windows messages for other applications (this can be a security problem, for example with keylogger spyware). However, the CBT Hook method can be used to install a hook that receives other window message inputs.

    However, note that a Windows feature called UIPI can cause problems with CBT hooks.

    0 讨论(0)
提交回复
热议问题