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. Mouse and Keyboard question

Mouse and Keyboard question

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicstutorial
4 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.
  • L Offline
    L Offline
    Luis E Cuadrado
    wrote on last edited by
    #1

    Hello everybody: I want a function to be exectured when I press CTRL + Click over a bitmap image in a Dialog. I know how to do that when I to a Ctrl + Click over the Dialog itself using the OnLButtonDown() function. What do I need to do to make it happen by just clicking the bitmap image? Any answer is more than welcome. Regards, Luis E. Cuadrado :0)

    R 1 Reply Last reply
    0
    • L Luis E Cuadrado

      Hello everybody: I want a function to be exectured when I press CTRL + Click over a bitmap image in a Dialog. I know how to do that when I to a Ctrl + Click over the Dialog itself using the OnLButtonDown() function. What do I need to do to make it happen by just clicking the bitmap image? Any answer is more than welcome. Regards, Luis E. Cuadrado :0)

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      Place the bitmap in a static text control on your dialog. Give the control a unique ID and set the notify style for it. You can then write a handler for BN_CLICKED for the static control and check to see whether the control key is pressed (GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL)) Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.

      L 2 Replies Last reply
      0
      • R Roger Allen

        Place the bitmap in a static text control on your dialog. Give the control a unique ID and set the notify style for it. You can then write a handler for BN_CLICKED for the static control and check to see whether the control key is pressed (GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL)) Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.

        L Offline
        L Offline
        Luis E Cuadrado
        wrote on last edited by
        #3

        Hello: I tried what you told me and this is what I put in my code: **void CMyClass::OnPicClicked() { // TODO: Add your control notification handler code here if ((GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL))) { //MY STUFF HERE } }** Does that looks correct? I run my application and it doesn't work. Thank you for your reply. Regards, Luis E. Cuadrado :0)

        1 Reply Last reply
        0
        • R Roger Allen

          Place the bitmap in a static text control on your dialog. Give the control a unique ID and set the notify style for it. You can then write a handler for BN_CLICKED for the static control and check to see whether the control key is pressed (GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL)) Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.

          L Offline
          L Offline
          Luis E Cuadrado
          wrote on last edited by
          #4

          In my previous post I told you that I didn't work. I take that back. It works. I forgot to set the notify style for the CStatic. Works perfect. Thank you very much. Regards, Luis E. Cuadrado :0)

          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