A. Create a CEdit derivative (CMyEdit) and create an OnChar() message map entry.
// Assume that CMyEdit is derived from the CEdit class.
afx_msg void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == 'a' || nChar == 'A')
{
nChar = 'X';
}
DefWindowProc(WM_CHAR, nChar, MAKELONG(nRepCnt, nFlags));
}
Thank you!
ReplyDeleteDefWindowProc(WM_CHAR, nChar, MAKELONG(nRepCnt, nFlags));
It helps me solve my problem in my OnChar() function :D