• 6214阅读
  • 1回复

Qt能否捕获windows的全局事件? [复制链接]

上一主题 下一主题
离线wxyao
 

只看楼主 正序阅读 楼主  发表于: 2010-10-29
— 本帖被 XChinux 执行加亮操作(2010-10-29) —
看到事件处理的那块,看到几个相关的函数

bool filterEvent ( void * message, long * result )
virtual bool notify ( QObject * receiver, QEvent * event )
EventFilter setEventFilter ( EventFilter filter )
virtual bool winEventFilter ( MSG * msg, long * result )


bool QCoreApplication::winEventFilter ( MSG * msg, long * result )   [virtual]

The message procedure calls this function for every message received. Reimplement this function if you want to process window messages msg that are not processed by Qt. If you don't want the event to be processed by Qt, then return true and set result to the value that the window procedure should return. Otherwise return false.

It is only directly addressed messages that are filtered. To handle system wide messages, such as messages from a registered hot key, you need to install an event filter on the event dispatcher, which is returned from QAbstractEventDispatcher::instance().



那个 MSG是不是 windows的API的东西?
http://msdn.microsoft.com/zh-cn/library/system.windows.interop.msg_members(v=VS.85).aspx
[ 此帖被wxyao在2010-10-29 11:56重新编辑 ]
离线XChinux

只看该作者 1楼 发表于: 2010-10-29
对。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
快速回复
限100 字节
 
上一个 下一个