16,471
社区成员
发帖
与我相关
我的任务
分享
#include<afxwin.h>
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
protected:
afx_msg void OnMouseMove(UINT nFlags,CPoint point );
afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
afx_msg LRESULT OnNcHitTest( CPoint point );
afx_msg BOOL OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message );
DECLARE_MESSAGE_MAP()
};
#include "CMainWindow.h"
BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONDOWN()
ON_WM_NCHITTEST()
ON_WM_SETCURSOR()
END_MESSAGE_MAP()
CMainWindow::CMainWindow()
{
Create(NULL,L"");
SetCapture();
}
void CMainWindow::OnMouseMove(UINT nFlags,CPoint point)
{
TRACE(L"x=%d\ty=%d\n",point.x,point.y);
CFrameWnd::OnMouseMove(nFlags,point);
}
void CMainWindow::OnLButtonDown( UINT nFlags, CPoint point )
{
::ReleaseCapture();
}
BOOL CMainWindow::OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message )
{
TRACE(L"OnSetCursor\n");
return CFrameWnd::OnSetCursor(pWnd, nHitTest, message);
}
LRESULT CMainWindow::OnNcHitTest( CPoint point )
{
TRACE(L"OnNcHitTest\n");
return CFrameWnd::OnNcHitTest(point);
}