home *** CD-ROM | disk | FTP | other *** search
- // mymouvw.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "mymouse.h"
- #include "mymouvw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMymouseView
-
- IMPLEMENT_DYNCREATE(CMymouseView, CFormView)
-
- CMymouseView::CMymouseView()
- : CFormView(CMymouseView::IDD)
- {
- //{{AFX_DATA_INIT(CMymouseView)
- m_EditBoxContents = "";
- //}}AFX_DATA_INIT
- }
-
- CMymouseView::~CMymouseView()
- {
- }
-
- void CMymouseView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMymouseView)
- DDX_Text(pDX, IDC_EDIT1, m_EditBoxContents);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CMymouseView, CFormView)
- //{{AFX_MSG_MAP(CMymouseView)
- ON_WM_LBUTTONDOWN()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMymouseView message handlers
-
-
- void CMymouseView::OnLButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- char LFCR[3]; // Variable to hold LF+CR
-
- LFCR[0] = 13; // CR
- LFCR[1] = 10; // LF
- LFCR[2] = 0;
-
- // Update the variable of the edit box.
- m_EditBoxContents =
- (CString)" [v] Left Mouse Down " + LFCR;
-
-
- // Was the Ctrl key pressed?
- if ( (nFlags & MK_CONTROL) == MK_CONTROL )
- m_EditBoxContents =
- m_EditBoxContents + " [v] Ctrl " + LFCR;
- else
- m_EditBoxContents =
- m_EditBoxContents + " [ ] Ctrl " + LFCR;
-
- // Was the mouse right button pressed?
- if ( (nFlags & MK_RBUTTON) == MK_RBUTTON )
- m_EditBoxContents =
- m_EditBoxContents + " [v] Right Button down "
- + LFCR;
- else
- m_EditBoxContents =
- m_EditBoxContents + " [ ] Right Button down "
- + LFCR;
-
- // Was the SHIFT key pressed?
- if ( (nFlags & MK_SHIFT) == MK_SHIFT )
- m_EditBoxContents =
- m_EditBoxContents + " [v] SHIFT ";
- else
- m_EditBoxContents =
- m_EditBoxContents + " [ ] SHIFT ";
-
- // Update the screen with the new
- // value of m_EditBoxContents.
- UpdateData(FALSE);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- CFormView::OnLButtonDown(nFlags, point);
- }
-
-