Send a message to SWindow
| 216 | |
| 217 | // Send a message to SWindow |
| 218 | LRESULT SWindow::SSendMessage(UINT Msg, WPARAM wParam /*= 0*/, LPARAM lParam /*= 0*/,BOOL *pbMsgHandled/*=NULL*/) |
| 219 | { |
| 220 | LRESULT lResult = 0; |
| 221 | |
| 222 | if ( Msg < WM_USER |
| 223 | && Msg != WM_DESTROY |
| 224 | && Msg != WM_CLOSE |
| 225 | ) |
| 226 | { |
| 227 | TestMainThread(); |
| 228 | } |
| 229 | AddRef(); |
| 230 | SWNDMSG msgCur= {Msg,wParam,lParam}; |
| 231 | SWNDMSG *pOldMsg=m_pCurMsg; |
| 232 | m_pCurMsg=&msgCur; |
| 233 | |
| 234 | BOOL bOldMsgHandle=IsMsgHandled();//备分上一个消息的处理状态 |
| 235 | |
| 236 | SetMsgHandled(FALSE); |
| 237 | |
| 238 | ProcessSwndMessage(Msg, wParam, lParam, lResult); |
| 239 | |
| 240 | if(pbMsgHandled) *pbMsgHandled=IsMsgHandled(); |
| 241 | |
| 242 | SetMsgHandled(bOldMsgHandle);//恢复上一个消息的处理状态 |
| 243 | |
| 244 | m_pCurMsg=pOldMsg; |
| 245 | Release(); |
| 246 | |
| 247 | return lResult; |
| 248 | } |
| 249 | |
| 250 | void SWindow::SDispatchMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 251 | { |
no test coverage detected