SOUI自定义控件,如何响应控件范围外的其他事件?
第一步,继承
public IMessageFilter
重写
virtual BOOL PreTranslateMessage(MSG* pMsg);
构造函数中
GetMsgLoop()->AddMessageFilter(this);
析构函数中
GetMsgLoop()->RemoveMessageFilter(this);
获取消息循环
SMessageLoop * GetMsgLoop();
{
return SApplication::getSingletonPtr()->GetMsgLoop();
}
具体消息拦截
BOOL STimeLimitCtrl::PreTranslateMessage( MSG* pMsg )
{
if(pMsg->message==WM_LBUTTONDOWN)
}