Capturing specific keystrokes from a Listbox
I'm trying to make my main window to receive notifications when user presses a Delete key on a listbox's item. I've tried this:
case WM_CHARTOITEM:
if( lParam == (LPARAM)hwndListBox )
{
sprintf( debug, "0x%x", LOWORD(wParam) );
MessageBoxA(0, debug, 0, 0);
}
break;
..and I got all keystrokes except the Delete (and End, Home, Inert,开发者_如何学运维 PageUp, PageDown, arrows etc). Though I got Numpad's Delete keystroke.
Is there a way to do this?
Thank you.
Those keys don't produce a WM_CHAR message. You'll need WM_VKEYTOITEM to see them.
精彩评论