系统托盘区的一些代码如下
case WM_RBUTTONDOWN:
{
CPoint pt;
GetCursorPos(&pt);

AfxGetMainWnd()->SetForegroundWindow();
CMenu* psub=(CMenu*)m_menu.GetSubMenu(0);
psub->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,this);
         AfxGetMainWnd()->PostMessage(WM_NULL,0,0);
}
break;
不明白AfxGetMainWnd()->SetForegroundWindow();和AfxGetMainWnd()->PostMessage(WM_NULL,0,0);两句防在这个地方起到什么作用(语句本身我明白),去掉他们也没有影响啊。