I have created a grid (downloaded code) which contains some cells that
contain a CIPAddressCtrl. My goal is to have the right/left arrow keys
traverse through the cells of a row as each key is pressed, with the
exception of IP address cell. For this cell type, the focus should
traverse through each of the IP fields until focus gets to the last
field of the IP. Focus should then get set to the next cell in the
For regular cells having focus, the grid class is able to capture the
keyboard input via
OnKeyDown(). My problem is that once an IP field gains focus, I am no
longer able to capture keyboard input in the grid class or in the
derived CIPAddressCtrl class (CInPlaceIP). I printed out all messages
from the CInPlaceIP's WindowProc(), but see no keyboard entries. It
seems like each child IP field control does its own internal
OnKeyDown() handling and then sets focus to the next sibling field.
This initially appears fine, but I need to know when the arrow key is
entered so that I can force the focus to the next cell when the last IP
field has been reached. Otherwise, the focus will never leave the IP
control when using the arrow keys.
The CInPlaceIP gets WM_PARENTNOTIFY messages for each of the IP child
fields as they are created, but I haven't found a way to get into
those controls to over-ride their OnKeyDown() handling, or capture the
input before it gets to fields.
I'd appreciate any ideas on capturing keyboard input when any of the
four IP fields has focus.