BOOL CICCViewerDlg::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN) { WM_MOUSEMOVE; if(pMsg->wParam == VK_RETURN) OnOpen(); if(pMsg->wParam == VK_DELETE) OnDel(); if(pMsg->wParam == VK_F5) OnUpdate(); if(pMsg->wParam == VK_BACK) { if(GetFocus() == &m_tcFiles) OnBack(); } } if(IsWindow(m_toolCtrl.m_hWnd)) { m_toolCtrl.RelayEvent(pMsg); } return CDialog::PreTranslateMessage(pMsg); } void CICCViewerDlg::OnRclickFiles(NMHDR* pNMHDR, LRESULT* pResult) { CPoint point; GetCursorPos(&point); CMenu menu; VERIFY(menu.LoadMenu(IDR_CONTEXTFILE)); CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,point.x,point.y, this, NULL); *pResult = 0; }