mdi client area mouse events
After reading http://support.microsoft.com/kb/q133716/, I am
attempting to write a small test application which actually processes
mouse events on the mdi client area; the execution flow is not going
through OnRButtonUp(). What am I missing or what do I do wrong ? This
is the relevant code I have so far, which doesn't work as expected:
00000001 IMPLEMENT_DYNAMIC(MainFrame,CMDIFrameWnd)
00000002
00000003 BEGIN_MESSAGE_MAP(MainFrame,CMDIFrameWnd)
00000004 ON_WM_RBUTTONUP()
00000005 END_MESSAGE_MAP()
00000006
00000007 MainFrame::MainFrame() {
00000008 Create(NULL,"Battleship");
00000009 }
00000010 BOOL MainFrame::OnCreateClient(LPCREATESTRUCT
lpcs,CCreateContext *pContext) {
00000011 return CreateClient(lpcs,NULL);
00000012 }
00000013
00000014 int MainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {
00000015 if(CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) {
00000016 TRACE("%s:%d\n",__FILE__,__LINE__);
00000017 return -1;
00000018 }
00000019 //m_MainFrameClient is a MainFrameClient (see below)
00000020 if(!m_MainFrameClient.SubclassWindow(m_hWndMDIClient)) {
00000021 TRACE("%s:%d\n",__FILE__,__LINE__);
00000022 return -1;
00000023 }
00000024 /**/ return 0;
00000025 }
00000026
00000027
00000028
00000029 IMPLEMENT_DYNAMIC(MainFrameClient,CWnd)
00000030
00000031 BEGIN_MESSAGE_MAP(MainFrameClient,CWnd)
00000032 ON_WM_RBUTTONUP()
00000033 END_MESSAGE_MAP()
00000034
00000035 MainFrameClient::MainFrameClient(void)
00000036 {
00000037 }
00000038
00000039 MainFrameClient::~MainFrameClient(void)
00000040 {
00000041 }
00000042
00000043 afx_msg void MainFrameClient::OnRButtonUp(UINT nFlags,CPoint
point) {
00000044 //AfxMessageBox(_T("frame client"));//using the debugger
00000045 }
00000046