//1、注册消息
UINT32 MSG_SUBTHREAD_CMD = ::RegisterWindowMessage("MSG_SUBTHREAD_CMD");
//2、添加消息处理函数
BEGIN_MESSAGE_MAP(CApplicationService1Dlg, CDialogEx)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(ID_BTN_SERVICE_RUN, &CApplicationService1Dlg::OnBnClickedBtnServiceRun)
ON_REGISTERED_MESSAGE(MSG_SUBTHREAD_CMD,&CApplicationService1Dlg::OnMsgSubThreadCmd)
END_MESSAGE_MAP()
//2.1 消息处理函数
LRESULT CApplicationService1Dlg::OnMsgSubThreadCmd(WPARAM wParam, LPARAM lParam)
{
return 0;
}
//3.发送消息
LRESULT result = ::SendMessage(AfxGetApp()->GetMainWnd()->GetSafeHwnd(),MSG_SUBTHREAD_CMD,(WPARAM)&request,(LPARAM)&response);
TRACE("%d",result);