I am trying to implement select all(via ctrl-a) in a CEdit control. I'm doing this by making a class which inherits CEdit and adding a handler for WM_KEYDOWN like this:
void CEditExtended::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
{
if((nChar == 0x41) && (GetKeyState(VK_CONTROL) & 0x8000) != 0))
SetSel(0, -1);
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}
Looking around on the web, this should work, but it never registers both ctrl and a at the same time, either one or the other.