ITPub博客

首页 > > > ATL向MFC的exe程序发送自定义消息,如何传递参数?

ATL向MFC的exe程序发送自定义消息,如何传递参数?

作者:choubou 时间:2019-11-06 13:48:39 0 删除 编辑


我的传递的参数定义为一个结构体,如下:

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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: c++求校验和
请登录后发表评论 登录
全部评论

注册时间:2019-10-08

  • 博文量
    175
  • 访问量
    10712