G. Kashtanov
G. Kashtanov

Reputation: 409

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.

Upvotes: 2

Views: 283

Answers (1)

Hans Passant
Hans Passant

Reputation: 942109

Those keys don't produce a WM_CHAR message. You'll need WM_VKEYTOITEM to see them.

Upvotes: 2

Related Questions