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. C / C++ / MFC
  4. Proper way to process messages to modeless dialogs

Proper way to process messages to modeless dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
questionloungeworkspace
1 Posts 1 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.
  • G Offline
    G Offline
    georgiek50
    wrote on last edited by
    #1

    I have run into a situation that has me a bit confused. I have a dialog in my app which has a tab control in it, and each different tab has a modeless dialog in it. I am trying to get keyboard functionality for the modeless dialogs (eg. using TAB to switch between button controls) but with no success. I have declared a global HWND hDlgModeless and put it into my main message loop like so: while (GetMessage (&msg, NULL, 0, 0)) { if ( hDlgModeless == NULL || !IsDialogMessage(hDlgModeless, &msg) ) { if ( !TranslateAccelerator(hwnd, hAccel, &msg) ) { TranslateMessage(&msg) ; DispatchMessage(&msg) ; } } } return msg.wParam; I create each modeless dialog from within the WM_INITDIALOG of the modal dialog (which has the tab control) setting the parent window to be the modal dialog and a common dialog procedure for all the modeless dialogs. When I process TCN_SELCHANGE I just set hDlgModeless to equal the current modeless dialog the user has selected from the tab. Everything works great except for keyboard functionality. Is my approach in dealing with messages or in general, the setup completely wrong?

    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