473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 9959

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: William Bub | last post by:
I am using VB 6.0 Working Model (the one with no help files). I have a form. On a portion of the form I have a Picture Box. On the PicBox I want to draw something to follow the mouse. I can detect...
3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
1
by: suhas | last post by:
Hi, I have an MDI app that allows user to create flowcharts. User can drag flowchart objects (squares, rectangles, elipses, etc) from the toolbar and put on a form. They should be able to move...
1
by: Jay | last post by:
I need to be able to move a Panel on a windows Form at run time using the mouse. I have tried adding a MouseDown event handler to the Panel and then within the MouseDown handler adding a MouseMove...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
6
by: Rob | last post by:
This is a curious problem. It seems like it should be quite easy. Of course a timer is used to determine when form should be closed, but how do you consistently reset the timer when the mouse is...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
3
by: wanwan | last post by:
I made a game with a window form that needs to record the mouse position to an array at 100 samples per second, so I use the mouse move event to do the job. The problem is the mouse move event...
5
by: Sabbaath | last post by:
First off, I've pretty much convinced myself that the issue is that there are onmouseover events inside the div that contains an onmouseover event on it... I wrote the message below first. This was...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.