BCMenu menu;
ClientToScreen(&pt);
menu.CreatePopupMenu();
UINT nFlag = MF_BYPOSITION;
//增加“取消缩放”菜单
menu.AppendMenu(nFlag, TEXT_MENU_ID_GROUP_BASE, "全选");
menu.AppendMenu(nFlag, TEXT_MENU_ID_GROUP_BASE+1, "复制 Ctrl+C");
int nItemID = menu.TrackPopupMenu( TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, pt.x, pt.y, this);
if( TEXT_MENU_ID_GROUP_BASE == nItemID)
{
SetSel(0, GetTextLength());
SetFocus();
return;
}
else if( TEXT_MENU_ID_GROUP_BASE+1 == nItemID)
{
Copy();
return;
}
ClientToScreen(&pt);
menu.CreatePopupMenu();
UINT nFlag = MF_BYPOSITION;
//增加“取消缩放”菜单
menu.AppendMenu(nFlag, TEXT_MENU_ID_GROUP_BASE, "全选");
menu.AppendMenu(nFlag, TEXT_MENU_ID_GROUP_BASE+1, "复制 Ctrl+C");
int nItemID = menu.TrackPopupMenu( TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, pt.x, pt.y, this);
if( TEXT_MENU_ID_GROUP_BASE == nItemID)
{
SetSel(0, GetTextLength());
SetFocus();
return;
}
else if( TEXT_MENU_ID_GROUP_BASE+1 == nItemID)
{
Copy();
return;
}