I've made this custom control (as I often do) but this thing relies on WM_CHAR and it appears that modal dialog boxes don't translate messages because the custom control doesn't get WM_CHAR when in one. I looked around and couldn't find any solutions or similar problems, but a test-bed reveals this is not a problem specific to my project. Thanks for any help in advance.
P.S. Yes, I realise what is causing the problem; modal dialog boxes have their own message loop (they must in order to suspend the calling thread) and this loop must simply not call TranslateMessage. I'm hoping to learn why, and how to fix it. =)

Win32 Modal Dialog Box
kmccaa
ry to check the complete situation with spy++. Who receives the message when pressing some characters.
Vaine
jcribbs
case WM_GETDLGCODE:
if(lParam){
LPMSG lpmsg = (LPMSG)lParam;
if( lpmsg->message == WM_CHAR){
return DLGC_WANTCHARS;
}
}
return 0;
See http://support.microsoft.com/kb/q83302/ for detail.
rmtuckerphx
Fantasiiio
The standard Modal Dialog message loop translates messages, otherwise a edit control in your dialog wouldn't work. I hope it works :-)
Rohan Singh
If it didn't have focus then Spy++ wouldn't get the messages.
MechGuru
So if you are using the plain api, your WindowProc should be in GetWindowLong GWL_WNDPROC. Just check this. If not another routine took control over your window by subclassing it.
Spy++ can tell you about the window proc, too.
Friction
I have trouble believing that something is subclassing all modal dialogs and not calling the replaced WndProc on WM_CHAR messages just to mess with me.
wishme
Thanks for the input reguardless Martin.
Imran Koradia
BTW, sometimes pointing the person posting the issue to the possible causes of the problem is actually an answer since it directs him/her where to investigate. It is just not the case for this post.
Thanks,
Ayman Shoukry
VC++ Team