soui-线程内更新界面,sendmessage

头文件定义消息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#define WM_MYMSG (WM_USER+100)

LRESULT OnMyMsg(UINT uMsg, WPARAM wp, LPARAM lp, BOOL & bHandled);

//HostWnd真实窗口消息处理
BEGIN_MSG_MAP_EX(CDlgLogin)
MESSAGE_HANDLER(WM_MYMSG, OnMyMsg)
MSG_WM_CREATE(OnCreate)
...


LRESULT CDlgLogin::OnMyMsg(UINT uMsg, WPARAM wp, LPARAM lp, BOOL & bHandled)
{
return 0;
}

在线程中发送消息

1
::PostMessage(pwnd->m_hWnd, WM_MYMSG, 2, 0);