case WM_RBUTTONDOWN://右击托盘,显示菜单
{
CMenu menu,*pSubMenu; //后面要用的CMenu对象
CPoint point;
menu.LoadMenu(IDR_MENU2); //装载自定义的右键菜单
pSubMenu = menu.GetSubMenu(0); //获取第一个弹出菜单
GetCursorPos(&point); //获取当前光标位置
SetForegroundWindow();
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN,point.x,point.y,this);//弹出菜单
break;
}