CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    Modeless Dialog Message handling

    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?


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Modeless Dialog Message handling

    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






  3. #3
    Join Date
    Apr 1999
    Posts
    3

    Re: Modeless Dialog Message handling

    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


  4. #4
    Guest

    Re: Modeless Dialog Message handling

    I have the same problem, and i use only MFC commands to build the dialog (Create, ShowWindow of CWnd)... Any response welcome...


  5. #5
    Join Date
    May 1999
    Posts
    3

    Re: Modeless Dialog Message handling

    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?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured