emwin消息传递
父窗口是桌面窗口
(1)子窗口调用    GUI_EndDialog(pMsg->hWin, 75);
父窗口在WM_NOTIFY_PARENT下会收到WM_NOTIFICATION_CHILD_DELETED 的消息,75是给模态对话框的返回值,对消息传递不影响;
父窗口可以通过WM_GetId(pMsg->hWinSrc);获得子窗口的ID
pMsg->hWin是本地窗口的句柄
(2)子窗口调用    WM_NotifyParent(pMsg->hWin, 0x99);
sendmessage返回值
父窗口在WM_NOTIFY_PARENT下会收消息,pMsg->Data.v是0x99
pMsg->hWin是本地窗口的句柄
(3)子窗口调用 WM_SendMessageNoPara(WM_GetParent(pMsg->hWin),0x99) ;
pMsg->hWin是本地窗口的句柄,但是必须通过WM_GetParent 获得目标窗口的句柄,0x99是消息ID
(4) 子窗口调用 WM_SendMessage(WM_GetParent(pMsg->hWin), &msg);
  msg.hWin = WM_GetParent(pMsg->hWin);
  msg.hWinSrc = pMsg->hWin;
msg.MsgId = 0x99;
msg.Data.v = 0x87;
  WM_SendMessage(WM_GetParent(pMsg->hWin), &msg);
注意:必须调用WM_GetParent(pMsg->hWin)父窗口的句柄,否则无法发送到父窗口;
(5) 子窗口调用WM_SendToParent (pMsg->hWin,&msg)
  msg.hWin = WM_GetParent(pMsg->hWin);
  msg.hWinSrc = pMsg->hWin;
msg.MsgId = 0x99;
msg.Data.v = 0x87;
WM_SendToParent (pMsg->hWin,&msg) ;
pMsg->hWin是本窗口的句柄,0x99是消息ID
父窗口是自己创建的FRAMEWIN
(1)子窗口调用    GUI_EndDialog(pMsg->hWin, 75);
同父窗口是桌面窗口
(2)子窗口调用    WM_NotifyParent(pMsg->hWin, 0x99);
同父窗口是桌面窗口
(3)子窗口调用 WM_SendMessageNoPara(WM_GetParent(pMsg->hWin),0x99) ;
同父窗口是桌面窗口
(4) 子窗口调用 WM_SendMessage(WM_GetParent(pMsg->hWin), &msg);
同父窗口是桌面窗口
(5) 子窗口调用WM_SendToParent (pMsg->hWin,&msg)
同父窗口是桌面窗口

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。