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. Screen mousemove event?

Screen mousemove event?

Scheduled Pinned Locked Moved C#
question
4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I need to receive an event whenever the mouse moves, anywhere on the screen (so I can test if the mouse has moved out of/into a target rectangle). The Screen object, however, has no mousemove event as far as I can tell. My current solution involves a fullscreen semitransparent window. This is a hassle and a kludge, however.

    N R 2 Replies Last reply
    0
    • L Lost User

      I need to receive an event whenever the mouse moves, anywhere on the screen (so I can test if the mouse has moved out of/into a target rectangle). The Screen object, however, has no mousemove event as far as I can tell. My current solution involves a fullscreen semitransparent window. This is a hassle and a kludge, however.

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      try

      protected override void OnMouseMove(MouseEventArgs mea)
      {
      
      }
      

      Nick Parker

      1 Reply Last reply
      0
      • L Lost User

        I need to receive an event whenever the mouse moves, anywhere on the screen (so I can test if the mouse has moved out of/into a target rectangle). The Screen object, however, has no mousemove event as far as I can tell. My current solution involves a fullscreen semitransparent window. This is a hassle and a kludge, however.

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

        i don't know how to do this in c#, but in my c++-times i wrote a mouse-system-hook-dll to handle system-wide mousemoves. there was no other (easier) way half a year ago. :( :wq

        R 1 Reply Last reply
        0
        • R Rupel

          i don't know how to do this in c#, but in my c++-times i wrote a mouse-system-hook-dll to handle system-wide mousemoves. there was no other (easier) way half a year ago. :( :wq

          R Offline
          R Offline
          Rupel
          wrote on last edited by
          #4

          another idea: maybe you can use the MouseEnter and MouseLeave messages each control (and so each form) provides. but if that still isn't your applications clientarea, this helps you only to make the transparent window smaller (so that its client-size fits the rectangle you need to observe), i.e. not the whole screen anymore. :wq

          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