2008年(909)
分类:
2008-05-06 21:32:04
下载源代码
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); }其它实现细节请参见源代码。 下载本文示例代码