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

Mouseover

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
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.
  • P Offline
    P Offline
    prathuraj
    wrote on last edited by
    #1

    how to find mouse is over on a particular control.

    H J 2 Replies Last reply
    0
    • P prathuraj

      how to find mouse is over on a particular control.

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2
      // ...somewhere in your control's class
      
      CPoint point;
      GetCursorPos(&point);
      
      CPoint clientPoint = point;
      ScreenToClient(&clientPoint);
      
      GetClientRect(&rectClient);
      if (rectClient.PtInRect(clientPoint))
      {    
          // mouse is over control
          ...
      }
      

      Best wishes, Hans


      [CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]

      1 Reply Last reply
      0
      • P prathuraj

        how to find mouse is over on a particular control.

        J Offline
        J Offline
        jk chan
        wrote on last edited by
        #3

        May you can use TrackMouseEvent function and capturing WM_MOUSEHOVER (&WM_MOUSELEAVE).

        If u can Dream... U can do it

        M 1 Reply Last reply
        0
        • J jk chan

          May you can use TrackMouseEvent function and capturing WM_MOUSEHOVER (&WM_MOUSELEAVE).

          If u can Dream... U can do it

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Apparently that wasn't an acceptable solution: Click[^] :)

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          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