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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. is there anyway to move mouse to any point?

is there anyway to move mouse to any point?

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

    is there anyway to move mouse to any point?

    RaviBeeR 1 Reply Last reply
    0
    • U ugur_basak

      is there anyway to move mouse to any point?

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      SetCursorPos() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      U 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        SetCursorPos() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        U Offline
        U Offline
        ugur_basak
        wrote on last edited by
        #3

        Actually, i want to show a tooltip in certain situations. I can show whenever i want it, but it is shown in the last mouse message's position. So i guess if i move it maybe i can show it where i want. is there a solution to show tooltip, in a certain position

        RaviBeeR 1 Reply Last reply
        0
        • U ugur_basak

          Actually, i want to show a tooltip in certain situations. I can show whenever i want it, but it is shown in the last mouse message's position. So i guess if i move it maybe i can show it where i want. is there a solution to show tooltip, in a certain position

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          I'm not sure I understand your question. Are you trying to display a tooltip that follows the mouse? If so, create the tooltip window, handle WM_MOUSEMOVE, and position it to the mouse's current location. Alternatively, use a timer to query the mouse's current location and move the tooltip everytime it changes. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

          U 1 Reply Last reply
          0
          • RaviBeeR RaviBee

            I'm not sure I understand your question. Are you trying to display a tooltip that follows the mouse? If so, create the tooltip window, handle WM_MOUSEMOVE, and position it to the mouse's current location. Alternatively, use a timer to query the mouse's current location and move the tooltip everytime it changes. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

            U Offline
            U Offline
            ugur_basak
            wrote on last edited by
            #5

            OK. for example when an edit box sends EN_MAXTEXT i want to show "max text" as a tooltip. I can show tooltip whenever i want, but i cant show it wherever i want. it shows just where the mouse is over.

            T B RaviBeeR 3 Replies Last reply
            0
            • U ugur_basak

              OK. for example when an edit box sends EN_MAXTEXT i want to show "max text" as a tooltip. I can show tooltip whenever i want, but i cant show it wherever i want. it shows just where the mouse is over.

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              forcing the move to be the place you want your tooltip to be is very irritating for the user... if you cannot find how to display your tooltip where you want, then search again (or you're doing something wrong) !!


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              1 Reply Last reply
              0
              • U ugur_basak

                OK. for example when an edit box sends EN_MAXTEXT i want to show "max text" as a tooltip. I can show tooltip whenever i want, but i cant show it wherever i want. it shows just where the mouse is over.

                B Offline
                B Offline
                BlackDice
                wrote on last edited by
                #7

                if that's the case, I suggest subclassing the CToolTipCtrl class or creating your own class that just makes a generic label window, but with colors to make it mimic a tooltip My articles www.stillwaterexpress.com BlackDice

                1 Reply Last reply
                0
                • U ugur_basak

                  OK. for example when an edit box sends EN_MAXTEXT i want to show "max text" as a tooltip. I can show tooltip whenever i want, but i cant show it wherever i want. it shows just where the mouse is over.

                  RaviBeeR Offline
                  RaviBeeR Offline
                  RaviBee
                  wrote on last edited by
                  #8

                  I think you'd have to subclass the edit control to alter this behavior. Perhaps there's a style you can set to disable the default tooltip? If so, you could handle the EN_MAXTEXT notification and display your custom tooltip at a specific location. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

                  U 1 Reply Last reply
                  0
                  • RaviBeeR RaviBee

                    I think you'd have to subclass the edit control to alter this behavior. Perhaps there's a style you can set to disable the default tooltip? If so, you could handle the EN_MAXTEXT notification and display your custom tooltip at a specific location. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

                    U Offline
                    U Offline
                    ugur_basak
                    wrote on last edited by
                    #9

                    As always the solution is thinking basicly:) SendMessage(TTM_ADJUSTRECT, TRUE, (LPARAM)&rect); SetWindowPos(this,(rect.left+rect.right)/2, rect.top-50, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);

                    RaviBeeR 1 Reply Last reply
                    0
                    • U ugur_basak

                      As always the solution is thinking basicly:) SendMessage(TTM_ADJUSTRECT, TRUE, (LPARAM)&rect); SetWindowPos(this,(rect.left+rect.right)/2, rect.top-50, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);

                      RaviBeeR Offline
                      RaviBeeR Offline
                      RaviBee
                      wrote on last edited by
                      #10

                      Splendid! /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.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