wince项目,vs2005重写CMainFrame的PreTranslateMessage实现:
头文件添加:
virtual BOOL PreTranslateMessage(MSG* pMsg);
源文件添加:
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
if(pMsg->message==WM_KEYDOWN)
{
UINT iKey=(UINT)pMsg->wParam;
switch(iKey)
{
case VK_RETURN:
return true;
}
}
return CFrameWnd::PreTranslateMessage(pMsg);
}
---------------------------模式显示提示框------------------------------------------------------------------------------------------------------------
::MessageBox(AfxGetMainWnd()->m_hWnd,_T("提示语"), _T("标题"), MB_ICONWARNING|MB_TASKMODAL);
int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
------------------------------------------------------------------------------------------------------------------------------------------------------------