by Neville Franks - Soft As It Gets
In part one, I said I decided on using the Alt+Delete key sequence for deleting entries. Alt+Delete is a System key which means we must process WM_SYSKEYxxx messages on the look out for it. When WM_SYSKEYDOWN and WM_SYSKEYUP are received, wParam contains the virtual key code for the key pressed. VK_DELETE is the virtual key code for the Delete key.
If the Windows message or key pressed are of no interest to us we simply call the original system defined window procedure to perform whatever default processing it deems appropriate. In setting up the subclass procedure earlier, we saved away the address of default window procedure in lpfnEditWndProc.
This is where we put it to use.
This article has covered several arenas of Windows programming I hope you will find of interest. Along the way I've presented some code to manage the editing and deletion of information in a Windows combobox control which may be of use in your next Windows program. I've been programming solidly in Windows for some time now and quite often want to do things which seem almost impossible at the time. Inevitably though by scratching beneath the surface and searching out the information I'm able to accomplish these interesting feats after all.
Fortunately for us all, the developers of Windows have provided mechanisms
like subclassing, and interesting messages like WM_GETDLGCODE which lets us
perform these sorts of neat and useful tricks. Many of which I'm sure were
never contemplated when Windows was designed.