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 coordinates are too big

Mouse coordinates are too big

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 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.
  • R Offline
    R Offline
    rkwan
    wrote on last edited by
    #1

    Im using dinput.h's GetDeviceState to retrieve the current mouse cursor position. Why do I get coordinates returned in the billions??? I get the same result using ints and longs for x&y. All I want are pixel coordinates within the range of my window app. Any help would be much appreciated Thanks, Rob

    J R 2 Replies Last reply
    0
    • R rkwan

      Im using dinput.h's GetDeviceState to retrieve the current mouse cursor position. Why do I get coordinates returned in the billions??? I get the same result using ints and longs for x&y. All I want are pixel coordinates within the range of my window app. Any help would be much appreciated Thanks, Rob

      J Offline
      J Offline
      Jon Hulatt
      wrote on last edited by
      #2

      Says MSDN- > The mouse is a relative-axis device, so the absolute axis positions for mouse axes are simply accumulated relative motion. Therefore, the value of the absolute axis position is not meaningful except in comparison with other absolute axis positions. Why don't you just handle WM_MOUSEMOVE events instead? Potentially with a SetCapture() first. Signature space for rent. Apply by email to....

      1 Reply Last reply
      0
      • R rkwan

        Im using dinput.h's GetDeviceState to retrieve the current mouse cursor position. Why do I get coordinates returned in the billions??? I get the same result using ints and longs for x&y. All I want are pixel coordinates within the range of my window app. Any help would be much appreciated Thanks, Rob

        R Offline
        R Offline
        rjuncu
        wrote on last edited by
        #3

        As far as I know, GetCursorPos() works very well, this gets your position in screen coordinates, you can use ScreenToClient() after that. Romeo JUNCU

        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