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. OnCommand and Pretranslate message

OnCommand and Pretranslate message

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 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
    ns
    wrote on last edited by
    #1

    I put in a handler for both functions. IF I step in, on hitting enter in my textbox, I find that if the pretranslate code is there (returning true after handling VK_RETURN and KDOWN ) the OnCommand doesnt get triggered. I am trying to figure out why but not getting the reason from MSDN. Is this behavior to be expected and if so why? I cant quite figure out what translate msg does that makes onCommnad not run.. In the onCommand I look at the wParam,lParam and IDOK) Appreciate your help, ns

    B 1 Reply Last reply
    0
    • N ns

      I put in a handler for both functions. IF I step in, on hitting enter in my textbox, I find that if the pretranslate code is there (returning true after handling VK_RETURN and KDOWN ) the OnCommand doesnt get triggered. I am trying to figure out why but not getting the reason from MSDN. Is this behavior to be expected and if so why? I cant quite figure out what translate msg does that makes onCommnad not run.. In the onCommand I look at the wParam,lParam and IDOK) Appreciate your help, ns

      B Offline
      B Offline
      Brigsoft
      wrote on last edited by
      #2

      >IF I step in, on hitting enter in my textbox Are you sure that OnCommand had to be generated on this event? For examlpe, OnComand will be generate if you click some button, but not if the button set focus or lost using Tab key. Pretranslate massege gets ALL messages. And if you do all right WM_COMMAND will be prosecute or not, how you want. ================================ Useful links

      N 1 Reply Last reply
      0
      • B Brigsoft

        >IF I step in, on hitting enter in my textbox Are you sure that OnCommand had to be generated on this event? For examlpe, OnComand will be generate if you click some button, but not if the button set focus or lost using Tab key. Pretranslate massege gets ALL messages. And if you do all right WM_COMMAND will be prosecute or not, how you want. ================================ Useful links

        N Offline
        N Offline
        ns
        wrote on last edited by
        #3

        I see in my debugging that OnCommand indeed does fire when you hit enter (if no pretranslate msg). But thanks for thinking about it...:) Appreciate your help, ns

        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