Click to See Complete Forum and Search --> : Modeless Dialog Message handling
Stewart Ponsford
April 28th, 1999, 04:10 AM
I have a DLL with a modeless dialog. But when pressing the TAB key focus does not rotate around the dialog's controls. I have tried trapping for keyboard events in WM_KEYDOWN and PreTranslateMessage. But there is no event. What is happening?
Paul McKenzie
April 28th, 1999, 12:35 PM
Are you using the Windows API to implement the modeless dialog or MFC? If it's Windows API, you have to call IsDialogMessage(hwndDialog) in the parent's message queue processing to make sure that the dialog gets its messages.
Regards,
Paul McKenzie
Stewart Ponsford
April 29th, 1999, 03:36 AM
Hi Paul, thanks for the tip.
I tried using this function as suggested in the calling app, but it doesnt ever return TRUE. What i have found in PreTranslateMessage on the parent App. is that when tab is pressed on the DLLs modeless dlgs, a message for that control appears.
Any suggestions as the best way to get this message passed on to the dialog in the DLL?
Any help greatly appreciated, Stew
I have the same problem, and i use only MFC commands to build the dialog (Create, ShowWindow of CWnd)... Any response welcome...
JerPom
June 1st, 1999, 09:54 AM
See in msdn, you must subclass the message handler of your app (in MFC, subclass the PreTranslateMessage), and call an user function of your dll (for example TranslateMessage). This function must call the PreTranslateMessage of the dll's CWinApp, like: AfxGetWinApp ()->PreTranslateMessage (pmsg).
I try this, it's O.K. but what is the process in a VB app or a Delphi app?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.