Re: Modeless Dialogs and WM_CHAR
From: Callum Winter (callum_at_REMOVE_THISwinter9999.fsnet.co.uk)
Date: 02/01/05
- Next message: Tom Widmer: "Re: What's going on here?!"
- Previous message: BigMan: "Re: What's going on here?!"
- In reply to: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Next in thread: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Reply: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Feb 2005 13:23:04 -0000
> This is the part of your question that that I don't get. Keystroke
messages
> go to the window with the focus, no? And if you have a modeless dialog you
> are pumping messages something like this
yes
>
> if ( !IsDialogMessage(hMyDialog, &msg) )
> {
> TranslateMessage(&msg);
> DIspatchMessage(&msg);
> }
>
> No?
Yup exactly like that but i dont get the keystroke messages, when the
application window has focus.
> If you want to capture the keystrokes in a window of a class whose window
> procedure you did not write the usual tack would be to subclass the
window,
> respond to the WM_GETDLGCODE message to tell the dialog manager which
> keystroke messages you are interested in, and do what you like in the
> subclassed window procedure. Developers do this _all the time_ to bring
> special functionality to edit controls, for example.
So your saying the default behaviour of a modeless dialog created with
CreateDialog() is not to receive WM_CHAR in fact not to recieve any
keystroke messages in the callback, and i need to subclass the dialog so I
can respond to WM_GETDLGCODE to make it generate them.??.
I own Charles Petzold Fifth Edition but cant find anything on WM_GETDLGCODE
in there (at least its not mentioned in the index), guess Im stuck with the
online docs, for this one. oh well.
>
> Another option is to install a _thread-specific_ keyboard hook - check the
> docs for SetWindowsHookEx(WH_KEYBOARD, ...). With it you can get first
crack
> at _all_ keystrokes going to _all_ windows in a therad.
This sounds interesting, ill have a look at that aswell.
Thanks for the advice, at least I have something to go on now.
Callum.
- Next message: Tom Widmer: "Re: What's going on here?!"
- Previous message: BigMan: "Re: What's going on here?!"
- In reply to: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Next in thread: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Reply: William DePalo [MVP VC++]: "Re: Modeless Dialogs and WM_CHAR"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|