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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. PreTranslateMessage(MSG* pMsg)

PreTranslateMessage(MSG* pMsg)

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structureshelp
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.
  • U Offline
    U Offline
    User 4315
    wrote on last edited by
    #1

    Hi, I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog. So, when the user presses the left mouse button he is not pressing it in the dialog, he is pressing it in the tree. As a result, I am trying to make use of PreTranslateMessage. What I was wondering was how do I detect when the the user has pressed the left mouse button while holding down the shift key in PreTranslateMessage(MSG* pMsg)? Also, is there an easier way to do this? Thanks Mike

    M 1 Reply Last reply
    0
    • U User 4315

      Hi, I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog. So, when the user presses the left mouse button he is not pressing it in the dialog, he is pressing it in the tree. As a result, I am trying to make use of PreTranslateMessage. What I was wondering was how do I detect when the the user has pressed the left mouse button while holding down the shift key in PreTranslateMessage(MSG* pMsg)? Also, is there an easier way to do this? Thanks Mike

      M Offline
      M Offline
      Mike Dunn
      wrote on last edited by
      #2

      You get an NM_CLICK notification when the user clicks in the tree. As for the keyboard, call GetKeyState(VK_SHIFT) to tell if Shift is pressed.

      U 1 Reply Last reply
      0
      • M Mike Dunn

        You get an NM_CLICK notification when the user clicks in the tree. As for the keyboard, call GetKeyState(VK_SHIFT) to tell if Shift is pressed.

        U Offline
        U Offline
        User 4315
        wrote on last edited by
        #3

        Thanks alot mike.

        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