64,651
社区成员
发帖
与我相关
我的任务
分享
在CTtView的类定义里面,定义一个成员数组:
CPoint cp[100];
void CTtView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
static int i = 0;
if (i < 100)
{
cp[i++] = point;
}
CView::OnLButtonDown(nFlags, point);
}
myProjectName:Tt
重载CTtView的WM_LBUTTONDOWN消息
void CTtView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CView::OnLButtonDown(nFlags, point);
}
CWnd::OnLButtonDown
afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
Parameters
nFlags
Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL Set if the CTRL key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the SHIFT key is down.
point
Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.