views:

11

answers:

1

Hello. 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.

A: 

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

Hans Passant
Thanks, that worked. Also, for those who'll find this question: listbox will need a LBS_WANTKEYBOARDINPUT style to produce WM_CKEYTOITEM.
Talis