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. mouseleave

mouseleave

Scheduled Pinned Locked Moved C / C++ / MFC
comdockerhelp
4 Posts 4 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.
  • S Offline
    S Offline
    sdfdsfa
    wrote on last edited by
    #1

    I am looking for a way to get the mouseleave/mouseout method for my activex control. When I test with ActiveX container tester mousemove can get the event when it is on the control. However, once the mouse is out of control, i don't get anything. Thank you for help Shin

    J 1 Reply Last reply
    0
    • S sdfdsfa

      I am looking for a way to get the mouseleave/mouseout method for my activex control. When I test with ActiveX container tester mousemove can get the event when it is on the control. However, once the mouse is out of control, i don't get anything. Thank you for help Shin

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      You can use the TrackMouseEvent[^] API. It only works on Win98 or above, so if you need Win95 compatibility, you'll have to simulate MouseLeave using a timer: Start the timer when the mouse is first moved into the control. In the timerproc, use GetCursorPos to see if the cursor is outside of the window. If it is, fire a MouseLeave event, and stop the timer.

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      R 1 Reply Last reply
      0
      • J J Dunlap

        You can use the TrackMouseEvent[^] API. It only works on Win98 or above, so if you need Win95 compatibility, you'll have to simulate MouseLeave using a timer: Start the timer when the mouse is first moved into the control. In the timerproc, use GetCursorPos to see if the cursor is outside of the window. If it is, fire a MouseLeave event, and stop the timer.

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        :-D Cool! I wish I'd known about that. The number of times I've used SetCapture() and tested the location of the mouse cursor... :omg:

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        S 1 Reply Last reply
        0
        • R Ryan Binns

          :-D Cool! I wish I'd known about that. The number of times I've used SetCapture() and tested the location of the mouse cursor... :omg:

          Ryan

          "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

          S Offline
          S Offline
          shinay
          wrote on last edited by
          #4

          Thanks for the helpfull post How to use this TrackMouseEvent? I have been looking for and they said I have to add #define _WIN32_WINNT 0x0400 this line. Still said TrackMouseEvent is not defined. So I added #include the result is the same....

          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