16,473
社区成员
发帖
与我相关
我的任务
分享
BOOL CXXDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
ASSERT(pEdit);
if(WM_CHAR == pMsg->message && pEdit->GetSafeHwnd() == pMsg->hwnd)
{
if(_istlower(pMsg->wParam))
{
pMsg->wParam -= 0x20;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CTesteditDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if( WM_CHAR == pMsg->message )
{
CWnd *pWnd = GetFocus();
if( pWnd )
{
if( IDC_EDIT1 == pWnd->GetDlgCtrlID() )
{
if( pMsg->wParam >= 'a' && pMsg->wParam <= 'z' )
{
pMsg->wParam -= 0x20;
}
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}