Trying to get SetCursorPos to work

pr0fess0r

New member
Joined
Feb 13, 2005
Messages
3
Programming Experience
5-10
Hi all

I'm using com ports to send mouse movements from one computer to another.
I've run into a problem where when I execute SetCursorPos it only seems to affect the mouse's X position - the mouse moves back and forth, but only at the top of the screen, it's ignoring the Y value.
This is in VB.NET
I'm declaring SetCursorPos as

VB.NET:
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long

and calling it as

VB.NET:
SetCursorPos(mouseX, mouseY)

with positive mouseX and mouseY values (both defined as Public integers)

Can anyone suggest a cause or a way to track the issue down?

many thanks in advance


Lucas
 
Ah, thanks for that. I'll try calling it with a parameter of null which apparently gives you full window access... cheers

Lucas
 
Back
Top