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#
  4. How can you track the mouse pointer if you leave the form......

How can you track the mouse pointer if you leave the form......

Scheduled Pinned Locked Moved C#
help
6 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.
  • G Offline
    G Offline
    glennPattonWork3
    wrote on last edited by
    #1

    Umm, is possible to track the mouse pointer if you move off the form, I have written an app that I needed to track the mouse pointer on the form. Now I am trying to track the mouse pointer out of the Form on the Windows back ground. I think I am having issues attaching the event handler < MouseHookProcedure = new HookProc(Form1.MouseHookProc); hHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, (IntPtr)0, 0); > dont appear to be setting hHook..... HELP:confused:

    R P L 3 Replies Last reply
    0
    • G glennPattonWork3

      Umm, is possible to track the mouse pointer if you move off the form, I have written an app that I needed to track the mouse pointer on the form. Now I am trying to track the mouse pointer out of the Form on the Windows back ground. I think I am having issues attaching the event handler < MouseHookProcedure = new HookProc(Form1.MouseHookProc); hHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, (IntPtr)0, 0); > dont appear to be setting hHook..... HELP:confused:

      R Offline
      R Offline
      reza assar
      wrote on last edited by
      #2

      Cursor.Position will retrieve current position of the cursor on the screen good luck

      G 1 Reply Last reply
      0
      • G glennPattonWork3

        Umm, is possible to track the mouse pointer if you move off the form, I have written an app that I needed to track the mouse pointer on the form. Now I am trying to track the mouse pointer out of the Form on the Windows back ground. I think I am having issues attaching the event handler < MouseHookProcedure = new HookProc(Form1.MouseHookProc); hHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, (IntPtr)0, 0); > dont appear to be setting hHook..... HELP:confused:

        P Offline
        P Offline
        Pravin Patil Mumbai
        wrote on last edited by
        #3

        I think http://www.freevbcode.com/ShowCode.asp?ID=2890[^] can help you.

        G 1 Reply Last reply
        0
        • R reza assar

          Cursor.Position will retrieve current position of the cursor on the screen good luck

          G Offline
          G Offline
          glennPattonWork3
          wrote on last edited by
          #4

          The simple answer, why oh why did I not think of that. Stick label1.Text = Cursor.Position.ToString(); in a timer and off you go!

          1 Reply Last reply
          0
          • P Pravin Patil Mumbai

            I think http://www.freevbcode.com/ShowCode.asp?ID=2890[^] can help you.

            G Offline
            G Offline
            glennPattonWork3
            wrote on last edited by
            #5

            Thanks, I will have a look at that Glenn

            1 Reply Last reply
            0
            • G glennPattonWork3

              Umm, is possible to track the mouse pointer if you move off the form, I have written an app that I needed to track the mouse pointer on the form. Now I am trying to track the mouse pointer out of the Form on the Windows back ground. I think I am having issues attaching the event handler < MouseHookProcedure = new HookProc(Form1.MouseHookProc); hHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, (IntPtr)0, 0); > dont appear to be setting hHook..... HELP:confused:

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              read up on Mouse.Capture :)

              Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

              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