dragon的sendmessage其实就是调用对象的肖息处理函数进行处理
//
// return
// 利用pMsg->lRet作为返回值。
// 事件响应函数的结果返回值作为pMsg->lRet;
// 如果事件响应函数没有返回值,pMsg->lRet默认为0
// remark
// 想要知道这个消息有没有被处理,可调用IsMsgHandled()
//
// 注:对于系统的SendMessage,它的nMsg有范围限制的:
// if(Msg&0xFFFE0000)// Msgs (>0xFFFF) are reserved by the system
// {
// User32._UserSetLaseError(0x57); //0x57 The parameter is incorrect.
// return 0;
// }
long UISendMessage(UIMSG* pMsg, int nMsgMapID, BOOL* pbHandled)
{
UIASSERT (pMsg != NULL);
if (NULL == pMsg)
{
UI_LOG_ERROR(_T("UISendMessage, pMsg==NULL! ") );
return -1;
}
UIASSERT(pMsg->pMsgTo != NULL);
// UIASSERT(pMsg->message != 0); // 有可能是WM_NULL
if (NULL == pMsg->pMsgTo)
{
UI_LOG_ERROR(_T("UISendMessage, pMessageTo==NULL! message=%d"), pMsg->message);
return -1;
}
BOOL bRet = pMsg->pMsgTo->ProcessMessage(pMsg, nMsgMapID, true);
if (pbHandled)
{
*pbHandled = bRet;
}
return pMsg->lRet;
}