分类: C/C++
2008-08-05 13:52:42
void CDlgDlg::OnLButtonDown(UINT nFlags, CPoint point) { PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x,pointy)); CDialog::OnLButtonDown(nFlags, point); }3、添加右键功能。已实现鼠标右键功能
void CDlgDlg::OnRButtonDown(UINT nFlags, CPoint point) { CMenu menu,*sub; menu.LoadMenu(IDR_MENU1); sub=menu.GetSubMenu(0); ClientToScreen(&point); sub->TrackPopupMenu(TPM_RIGHTBUTTON,point.x,point.y,this); CDialog::OnRButtonDown(nFlags, point); }其它实现细节请参见源代码。 下载本文示例代码