I/m trying to do a navigator in visual c++. I have a CEdit in a CDialogBar and i want to navigate throw the address in the edit control when the user push intro into the component, but i cannot get de WM_CHAR message, nor the WM_KEYDOWN, nor the WM_KEYUP. The program doesn't responds these message anywhere i write the code for the asociated funcions.
I have used DialogBar and dropped a combo box on it. I have put it on ReBar Control. Now on the ComboBox Ctrl+c and Ctrl+v doesn't work. But I can right mouse click and say copy/paste.
Any body knows how to enable these
How to make keyboard event work in CDialogBar derived class
Posted by hemant_jangid
on 10/24/2005 03:19am
Answer to this question and all other questions like Ctrl+C, Ctrl+X keys not working, tab key not moving focus etc. lies in the heart of every window object i.e. message pump.
Short answer: Because modeless dialogs and Dialogbar classes donbt provide the pre-translation of dialog keys.
Long answer: For implementation of keyboard accelerators, special behavior in dialogs require pre-translation of windows messages. For example, ctrl+x for ID_FILE_CUT and ctrl+v ID_FILE_PASTE.
Modal dialog class CDialog have a virtual function PreTranslateMessage which takes care of special dialog related keys. Root of all problems is that CDialogBar class doesnbt provide this functionality. To make it work, all we have to override above function in CDialogBar derived class. Following function addition can solve this problem for CDialogBarEx class.
// In CDialogBarEx.h
virtual BOOL PreTranslateMessage(MSG* pMsg);
// In CDialogBarEx.cpp
BOOL CDialogBarEx::PreTranslateMessage(MSG* pMsg)
if (pMsg->message >= WM_KEYFIRST && // for performance
pMsg->message <= WM_KEYLAST)
// Translate dialog key if applicable
Solution to this problem and many other windows message related problems can be found at following link:
I have got present solution also from this article. It is really an excellent article about MFC message handling and routing.
I have begun using this class and I have noticed that tree controls do not redraw properly. NOTHING appears until I click on it - and then when I do, only certain items appear... if I drag the window off screen and drag it back, EVERYTHING disappears again. I'm using the dialog bar as part of an MDI app. Any ideas?
Can u pls tell me the events to be trapped to know when a CDialogBar is 1]Docking and 2]Floating?
I need to resize my frame programatically, whenever the dialog bar is docked and floated and docked back.
Thankx Very much