且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用户按下字母键时如何停止CListCtrl的行选择?

更新时间:2023-12-03 10:03:52

不确定这样做是否可行,只是一个建议:您不能覆盖键盘吗?事件处理程序:OnCharOnKeyDownOnKeyUp ...用于此控件?
Not sure this will work, just a suggestion: can''t you override the keyboard event handlers: OnChar, OnKeyDown, OnKeyUp... for this control ?


我认为您可以使用
I think you can handle this situation using PreTranslateMessage in your dialog box

if(pMsg->hwnd == m_MyList.GetSafeHwnd())
{
    if(pMsg->message == WM_KEYDOWN)
    {
            //you will enter here when the key is pressed on list control
    }
}