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. Mouse button state

Mouse button state

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
8 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.
  • A Offline
    A Offline
    Abyss
    wrote on last edited by
    #1

    In OnMouseLeave method which is invoked when the WM_MOUSELEAVE message arrives I would like to determine the mouse button states too. Any idea how to do this? Do we have something like GetAsyncKeyState method which is for keyboard state? Thanks, Abyss

    C 1 Reply Last reply
    0
    • A Abyss

      In OnMouseLeave method which is invoked when the WM_MOUSELEAVE message arrives I would like to determine the mouse button states too. Any idea how to do this? Do we have something like GetAsyncKeyState method which is for keyboard state? Thanks, Abyss

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Abyss wrote:

      In OnMouseLeave method

      Wrong forum?

      Abyss wrote:

      WM_MOUSELEAVE

      ? :confused:

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      [my articles]

      A 1 Reply Last reply
      0
      • C CPallini

        Abyss wrote:

        In OnMouseLeave method

        Wrong forum?

        Abyss wrote:

        WM_MOUSELEAVE

        ? :confused:

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        [my articles]

        A Offline
        A Offline
        Abyss
        wrote on last edited by
        #3

        I'm not sure why do you think this is in wrong forum. :confused: It is a windows message (WINAPI) and used in C++ code. My application uses MFC to route this message. Which forum do you recommend for this question?

        C 1 Reply Last reply
        0
        • A Abyss

          I'm not sure why do you think this is in wrong forum. :confused: It is a windows message (WINAPI) and used in C++ code. My application uses MFC to route this message. Which forum do you recommend for this question?

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Sure? I cannot find any reference to WM_MOUSELEAVE on MSDN and OnMouseLeave is typically a method of .NET Framework controls. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          [my articles]

          modified on Tuesday, January 01, 2008 11:13:41 AM

          A 1 Reply Last reply
          0
          • C CPallini

            Sure? I cannot find any reference to WM_MOUSELEAVE on MSDN and OnMouseLeave is typically a method of .NET Framework controls. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            [my articles]

            modified on Tuesday, January 01, 2008 11:13:41 AM

            A Offline
            A Offline
            Abyss
            wrote on last edited by
            #5

            Absolutely - take a look at http://msdn2.microsoft.com/en-us/library/ms645615.aspx[^]

            C 1 Reply Last reply
            0
            • A Abyss

              Absolutely - take a look at http://msdn2.microsoft.com/en-us/library/ms645615.aspx[^]

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              OK, you're right, my bad :-O . Anyway have a look to GetAsyncKeyState documentation itself http://msdn2.microsoft.com/en-us/library/ms646293(VS.85).aspx[^] the following sentence looks promising: Remarks The GetAsyncKeyState function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, ... :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              [my articles]

              A 1 Reply Last reply
              0
              • C CPallini

                OK, you're right, my bad :-O . Anyway have a look to GetAsyncKeyState documentation itself http://msdn2.microsoft.com/en-us/library/ms646293(VS.85).aspx[^] the following sentence looks promising: Remarks The GetAsyncKeyState function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, ... :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                [my articles]

                A Offline
                A Offline
                Abyss
                wrote on last edited by
                #7

                Wow :omg: I was blind !!! I did not expect that GetAsyncKeyState can handle mouse buttons as well. I just tried and it really works and solved my problem. Many thanks. Abyss

                C 1 Reply Last reply
                0
                • A Abyss

                  Wow :omg: I was blind !!! I did not expect that GetAsyncKeyState can handle mouse buttons as well. I just tried and it really works and solved my problem. Many thanks. Abyss

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  Abyss wrote:

                  I did not expect that GetAsyncKeyState can handle mouse buttons as well.

                  I didn't expect too. I accidentally saw that remark: sometimes luck helps... :laugh: :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  [my articles]

                  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