471,089 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

mouse move event

I need to be able to detect mouse movement even when it is not over my
application. I can get the mouse cords using MousePosition but I am not
sure if there is an event that hits my program when the mouse is not over my
program.
One idea i had was make a child form that was transparent and use the
MouseMove event to keep that transparent window under the mouse but the
transparent window did not catch the MouseMove event.
I also tried putting a timer on the form that checks MousePosition but to
make it smooth i would have to check it so often that it is to processor
intensive.

Any help is appriciated,
Thanks in advance,
~Logan
Nov 15 '05 #1
3 9783

With API: GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As
POINTAPI) As Long


"Logan Mckinley" <lo***@globalweb.net> escribió en el mensaje
news:eN**************@TK2MSFTNGP09.phx.gbl...
I need to be able to detect mouse movement even when it is not over my
application. I can get the mouse cords using MousePosition but I am not
sure if there is an event that hits my program when the mouse is not over my program.
One idea i had was make a child form that was transparent and use the
MouseMove event to keep that transparent window under the mouse but the
transparent window did not catch the MouseMove event.
I also tried putting a timer on the form that checks MousePosition but to
make it smooth i would have to check it so often that it is to processor
intensive.

Any help is appriciated,
Thanks in advance,
~Logan

Nov 15 '05 #2
Am i correct that this API will just return the location of the mouse? If
so I am currently able to get that using "Cursor.Position". My problem is i
need to query this every time the mouse moves and don't know the event that
fires when the mouse is not over my form.
Thanks,
~Logan

"Rafael J. Pellicer" <ra******@cantv.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

With API: GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As
POINTAPI) As Long


"Logan Mckinley" <lo***@globalweb.net> escribió en el mensaje
news:eN**************@TK2MSFTNGP09.phx.gbl...
I need to be able to detect mouse movement even when it is not over my
application. I can get the mouse cords using MousePosition but I am not
sure if there is an event that hits my program when the mouse is not over
my
program.
One idea i had was make a child form that was transparent and use the
MouseMove event to keep that transparent window under the mouse but the
transparent window did not catch the MouseMove event.
I also tried putting a timer on the form that checks MousePosition but

to make it smooth i would have to check it so often that it is to processor
intensive.

Any help is appriciated,
Thanks in advance,
~Logan


Nov 15 '05 #3
You need to "Capture" the mouse, otherwise you will not receive mouse events
when pointer is outside your window.
To do this you set the Capture property of your form to true. When ever your
application looses focus you should set the Capture property back to false.

Normally you only use this "capture" function in controls within a form. If
you capture mouse events outside your main form I guess you need to pass the
events on to the window that the mouse hoovers.

/Magnus

"Logan Mckinley" <lo***@globalweb.net> wrote in message
news:OG*************@TK2MSFTNGP09.phx.gbl...
Am i correct that this API will just return the location of the mouse? If
so I am currently able to get that using "Cursor.Position". My problem is i need to query this every time the mouse moves and don't know the event that fires when the mouse is not over my form.
Thanks,
~Logan

"Rafael J. Pellicer" <ra******@cantv.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

With API: GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As
POINTAPI) As Long


"Logan Mckinley" <lo***@globalweb.net> escribió en el mensaje
news:eN**************@TK2MSFTNGP09.phx.gbl...
I need to be able to detect mouse movement even when it is not over my
application. I can get the mouse cords using MousePosition but I am not sure if there is an event that hits my program when the mouse is not over
my
program.
One idea i had was make a child form that was transparent and use the
MouseMove event to keep that transparent window under the mouse but the transparent window did not catch the MouseMove event.
I also tried putting a timer on the form that checks MousePosition but

to make it smooth i would have to check it so often that it is to processor intensive.

Any help is appriciated,
Thanks in advance,
~Logan



Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by William Bub | last post: by
1 post views Thread by suhas | last post: by
19 posts views Thread by wmanzo | last post: by
3 posts views Thread by wanwan | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.