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. PreTranslateMessage Problem???

PreTranslateMessage Problem???

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • L Offline
    L Offline
    Lizp
    wrote on last edited by
    #1

    I have a moduless dialog which has WS_CHILD property in a dll and used as an child in a view. when the dialog has focus ,it look the accelerator key massage as a dialog message and does not pass to it's parent(the view),while my purpose is that it should route the msg to the view and the dispatch to any it's child.Please tell me how to achieve this. some presetive code goes: In the view class: BOOL CTestAccelView::PreTranslateMessage(MSG* pMsg) { if(TranslateAccelerator(m_hWnd,m_hAccelTest,pMsg)) return TRUE; if(m_pTestDlgWnd && m_pTestDlgWnd->GetSafeHwnd() ) if(m_pTestDlgWnd->PreTranslateMessage(pMsg)) return TRUE; if(m_pTestDlgWnd2 && m_pTestDlgWnd2->GetSafeHwnd()) if(m_pTestDlgWnd2->PreTranslateMessage(pMsg)) return TRUE; return CView::PreTranslateMessage(pMsg); } In the Dialog class: BOOL CTestDlg::PreTranslateMessage(MSG* pMsg) { if(TranslateAccelerator(m_hWnd,m_hAccelTest,pMsg)) { return TRUE; } if(IsDialogMessage(pMsg)) { return TRUE; } return CWnd::PreTranslateMessage(pMsg); } Scratch

    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