User define dialog box, how do I trap WM_CHAR messages?

User define dialog box, how do I trap WM_CHAR messages?

Post by Jim Lync » Tue, 05 Aug 1997 04:00:00



It appears that the WM_CHAR message aren't passed down to my MFC created
dialog box.  I use Dialog::CreateIndirect.  I've subclassed the Dialog
class.  I looked at the messages via Spy and only saw WM_COMMAND message
going to the Frame.  No WM_CHAR anywhere.  I'd like to trap a keystroke
and substitute another for it.  

Any suggestions?

Thanks,
Jim.

 
 
 

User define dialog box, how do I trap WM_CHAR messages?

Post by Norman Bulle » Tue, 05 Aug 1997 04:00:00



> It appears that the WM_CHAR message aren't passed down to my MFC created
> dialog box.  I use Dialog::CreateIndirect.  I've subclassed the Dialog
> class.  I looked at the messages via Spy and only saw WM_COMMAND message
> going to the Frame.  No WM_CHAR anywhere.  I'd like to trap a keystroke
> and substitute another for it.

> Any suggestions?

> Thanks,
> Jim.

The dialog box routines handle WM_CHAR messages on their own, due to
complexities of control focus and navigation. With a modal dialog box
that is done in a message loop that is part of DialogBox(). In your case
you apparently have a mode-less dialog so you still have your own
message loop running and the dialog stuff is handled in
IsDialogMessage(). You may be able to handle (some) WM_CHAR messages
before you call IsDialogMessage().

Norm

 
 
 

1. trap wm_keydown& wm_char messages for a dialog

hi!
 this seems to be a nightmare for me!

im developing a win32(non MFC application) for keyboard mapping.
i create an array of button controls on a dialog. what i need to do
is, once the focus is on one of the button,and if the user presses any
of the key in the keyboard,i need to get the virtual keycode of that
key. i know that if i can trap the WM_KEYDOWN message, i can obtain
the Virtual Keycode.

But Dialogs doesnt seem to process the Wm_KEYDOWN (rather any of the
keystroke) message.

Is there anyother way i could do it?
pls advice

thanx in advance

RHODEO

2. dragging attachments into the window

3. EXTREMELY URGENT!: Trapping All Keystroke Messages in a Modal Dialog Box

4. KDD-93: AAAI Workshop on Knowledge Discovery in Databases - CFP

5. E Commerce Consulting

6. Trapping Dialog Box Messages

7. FS: Cisco 3662 loaded

8. Trapping Messages or Exanging Data on a Modeless Dialog Box using C++.

9. Adding user-defined control to dialog box

10. Trapping Keystrokes in a Dialog Box or Dialog based application

11. Help needed to send WM_CHAR to TEdit control in a Dialog Box.

12. Problem with WM_CHAR WM_KEYDOWN in a Dialog Box