我的传递的参数定义为一个结构体,如下:
struct MsgParm
{
BSTR fromuserid;
BSTR fromuserclass;
BSTR touserid;
BSTR touserclass;
BSTR fromusername;
BSTR msg;
BSTR sendtime;
};
在ATL中发送消息过程如下:
HWND myhwnd=::FindWindow(NULL,titiename);
if(myhwnd!=NULL)
{
//::MessageBox(NULL,_T("发送消息"),_T("已经存在!"),MB_OK);
MsgParm parmstr;
parmstr.fromuserid=fromuserid;
parmstr.fromuserclass=fromuserclass;
parmstr.touserid=touserid;
parmstr.touserclass=touserclass;
parmstr.fromusername=fromusername;
parmstr.msg=msg;
parmstr.sendtime=sendtime;
::SendMessage(myhwnd,ON_UM_MYMSG,(WPARAM)&parmstr, (LPARAM)&parmstr);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4548/viewspace-3145246/ ,如需转载,请注明出处,否则将追究法律责任。