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. Capturing mouse coordinates

Capturing mouse coordinates

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

    hello can u please suggest some code for capturing the mouse coordinates on clicking? :confused:

    J I V 3 Replies Last reply
    0
    • T techysavvy

      hello can u please suggest some code for capturing the mouse coordinates on clicking? :confused:

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

      Look up onmousemove in MSDN.


      I feel like I'm diagonally parked in a parallel universe Jerry Davis http://www.astad.org
      http://www.jvf.co.uk

      1 Reply Last reply
      0
      • T techysavvy

        hello can u please suggest some code for capturing the mouse coordinates on clicking? :confused:

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        From MSDN... afx_msg void OnLButtonDown( UINT nFlags, CPoint point ); ... point Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window. To get the coordinates into screen coordinates, use CWnd::ClientToScreen (...). Iain.

        1 Reply Last reply
        0
        • T techysavvy

          hello can u please suggest some code for capturing the mouse coordinates on clicking? :confused:

          V Offline
          V Offline
          Vitali Halershtein
          wrote on last edited by
          #4

          Hi, GetCursorPos function retrieves the cursor's position, in screen coordinates. Just use it in your click handler. BOOL GetCursorPos( LPPOINT lpPoint // cursor position ); Vitali http://www.creative-case.com

          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