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. GetCursorPos in Borland CPP

GetCursorPos in Borland CPP

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++delphi
3 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.
  • S Offline
    S Offline
    ScarberryProd
    wrote on last edited by
    #1

    i know how to get the command GetCursorPos working in vcpp but im having troubles porting to to borland cpp builder 6, it is giving me 2 odd errors. a simple example should do. thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

    S 1 Reply Last reply
    0
    • S ScarberryProd

      i know how to get the command GetCursorPos working in vcpp but im having troubles porting to to borland cpp builder 6, it is giving me 2 odd errors. a simple example should do. thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

      S Offline
      S Offline
      ScarberryProd
      wrote on last edited by
      #2

      o nm, it was just a stupid clash of varibles, i was using "Mouse" for my point. So as to help others, i will post what i did POINT MousePos; GetCursorPos(&MousePos); PopupMenu1->Popup(MousePos.x,MousePos.y); Remember that this is for borland cpp builder and not vcpp, although it is basically the same... ty --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

      M 1 Reply Last reply
      0
      • S ScarberryProd

        o nm, it was just a stupid clash of varibles, i was using "Mouse" for my point. So as to help others, i will post what i did POINT MousePos; GetCursorPos(&MousePos); PopupMenu1->Popup(MousePos.x,MousePos.y); Remember that this is for borland cpp builder and not vcpp, although it is basically the same... ty --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        Just a stylistic point: if you're creating a popup menu in response to a mouse message, you typically want to create the menu where the pointer was when the mouse was clicked, not where it is now. You get this co-ordinate in the message's lParam (see for example WM_LBUTTONDOWN). I'm not familiar with Borland C++ Builder, so I don't know how messages are processed in your application. The exception to this is if you're handling a system tray icon notification message, where you don't get the parameters to the original message (and hence the location of the click). You should use the message's cursor position because the user may have moved the mouse since clicking. If your application, or the system, is busy, this may cause the menu to appear somewhere different, which confuses the user. Stability. What an interesting concept. -- 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