So I've been lurking around the MSDN more now, and their information on how to catch key strokes in a ListView is pretty straight forward: Simply catch the LVN_KEYDOWN notification from the WM_NOTIFY message and you're all set... Except for one thing: I can't seem to catch "enter" key strokes. Here is the code:
Code:
case LVN_KEYDOWN:
{
switch(((NMLVKEYDOWN *)lParam)->wVKey)
{
case VK_RETURN:
{
displaySelected(((NMHDR *)lParam)->hwndFrom);
break;
}
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
break;
}
It catches just about every other key stroke without problem. I tested this by putting a messageBox right after the "case LVN_KEYDOWN"; it would pop up as expected for almost every key except the return key.
Does anyone know why this is? is there some special case/keycode that I am not aware of when catching the return key?
Thanks for any insight you can give me.