Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. WTL child window tabbing order

WTL child window tabbing order

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++helpannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nemo
    wrote on last edited by
    #1

    I have been tasked to update a WTL program. The program creates many modeless windows, the windows are created with style pop-up and the parent for the window is set to NULL in the create call. The main problem is the tabbing order on the modeless windows is not working. I have verified the VK_TAB message arrives in the main dialog(pretranslate message function) that created the modeless dialogs. How do I go about forwarding the message to the appropriate dialog, or is there a simpler solution to make the tabbing work? I have never had to work with the tabbing msgs before and it all seems a bit mysterious what is really going on. TIA

    I M 2 Replies Last reply
    0
    • N nemo

      I have been tasked to update a WTL program. The program creates many modeless windows, the windows are created with style pop-up and the parent for the window is set to NULL in the create call. The main problem is the tabbing order on the modeless windows is not working. I have verified the VK_TAB message arrives in the main dialog(pretranslate message function) that created the modeless dialogs. How do I go about forwarding the message to the appropriate dialog, or is there a simpler solution to make the tabbing work? I have never had to work with the tabbing msgs before and it all seems a bit mysterious what is really going on. TIA

      I Offline
      I Offline
      Igor Vigdorchik
      wrote on last edited by
      #2

      Try something like this:

      virtual BOOL PreTranslateMessage(MSG* pMsg)
      {
      // If it's a 'Tab' key then the child dialog should handle it
      if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB)
      return m_dlgChild.PreTranslateMessage(pMsg);
      }

      Then in your child dialog message handler you handle it. Igor.

      1 Reply Last reply
      0
      • N nemo

        I have been tasked to update a WTL program. The program creates many modeless windows, the windows are created with style pop-up and the parent for the window is set to NULL in the create call. The main problem is the tabbing order on the modeless windows is not working. I have verified the VK_TAB message arrives in the main dialog(pretranslate message function) that created the modeless dialogs. How do I go about forwarding the message to the appropriate dialog, or is there a simpler solution to make the tabbing work? I have never had to work with the tabbing msgs before and it all seems a bit mysterious what is really going on. TIA

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Each modeless window (I assume they're all dialogs?) should derive from CMessageFilter and override the PreTranslateMessage() method. The PreTranslateMessage() would do:

        BOOL CYourWindow::PreTranslateMessage ( MSG* pMsg )
        {
        return IsDialogMessage ( pMsg );
        }

        In each window's OnInitDialog(), register for pre-translate calls with:

        CMessageLoop* pLoop = _Module.GetMessageLoop();

        ATLASSERT(pLoop != NULL);
        pLoop->AddMessageFilter ( this );

        Look at the wizard-generated CMainFrame::OnCreate() if this part is still unclear. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

        P 1 Reply Last reply
        0
        • M Michael Dunn

          Each modeless window (I assume they're all dialogs?) should derive from CMessageFilter and override the PreTranslateMessage() method. The PreTranslateMessage() would do:

          BOOL CYourWindow::PreTranslateMessage ( MSG* pMsg )
          {
          return IsDialogMessage ( pMsg );
          }

          In each window's OnInitDialog(), register for pre-translate calls with:

          CMessageLoop* pLoop = _Module.GetMessageLoop();

          ATLASSERT(pLoop != NULL);
          pLoop->AddMessageFilter ( this );

          Look at the wizard-generated CMainFrame::OnCreate() if this part is still unclear. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

          P Offline
          P Offline
          Pharago
          wrote on last edited by
          #4

          use accelerators

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups