Are you familiar with subclassing controls using the techniques described in
the following:
http://www.cpp.atfreeweb.com/SubclassingControls.html
http://www.cpp.atfreeweb.com/DerivedControls.html
If not then familiarizing yourself with those techniques will help
immensely. The default processing of keyboard messages such as WM_CHAR is
for them to never be sent to a dialog unless the dialog is totally empty of
anything else for them to go to. That is the way you want things to work
because then the control receinving the message knows who got the key; the
control that gets the message got the key. However, in the case of many
non-ASCII keys such as function keys, the WM_CHAR message is not sent; you
will need to process a WM_KEYDOWN (or WM_KEYUP) message.
For an application such as this, a SDI application using CFormView would
probably be easier over-all because some of the things you want to do and
will want to do will actually be easier than in a dialog-based application.
Quote:
> Hi Gang,
> Simple question.... (I Hope)..
> I want to take a Cedit control and subclass it.
> Then, I'd like to take two different controls and place them on my dialog
> box.
> What I'm trapping for is the OnChar command. I'm looking for a function
> key, when hit, to process some value lookup, etc.
> What I can't figure out is how I know what control I'm sitting on.
> Let's apply this to a database, I'll use the F4 key to do lookups into the
> database. Thing is, I need to know what field I am sitting on to go do my
> lookups in.
> Question is, how do I know which one I am on?
> Thanks,
> Nick
> env: W2K/sp1, VC6/sp5