1。在stdafx.h 中
static UINT WM_MY_MESSAGE=RegisterWindowMessage("Message");
2。在框架中
CView *p = GetActiveView();
p->PostMessage(WM_MY_MESSAGE,(WPARAM)3,0);
3。在试图中
afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
WPARAM W1;
LPARAM L1;
ON_REGISTERED_MESSAGE(WM_MY_MESSAGE,OnMyMessage)
LRESULT CMFCApplicationView::OnMyMessage(WPARAM w,LPARAM l)
{
CRect rect;
GetClientRect(&rect);
InvalidateRect(&rect);
test=!test;
W1 = w;
L1= l;
return 0;
}