G
Glenn Palomar
Hi,
I'm trying to use the following user32 API's in vb.net:
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx
As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As
Long)
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y
As Long) As Long
When I use the mouse_event to move the mouse to another location, it does
not seem to work correctly. However in VB6, the above APIs work perfectly.
For example, I do the following:
SetCursorPos(640, 512)
Mouse_Event(MOUSEEVENTF_MOVE, 100, 100, 0, 0)
What happens is that instead of moving to location (740, 612) the mouse goes
to location (640, 612). The dx argument somehow is not understood.
Can anyone tell me what else I can do? Or is there an equivalent .net
function that is available to do the same thing instead of using user32 API.
Thanks for the help,
Glenn
I'm trying to use the following user32 API's in vb.net:
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx
As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As
Long)
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y
As Long) As Long
When I use the mouse_event to move the mouse to another location, it does
not seem to work correctly. However in VB6, the above APIs work perfectly.
For example, I do the following:
SetCursorPos(640, 512)
Mouse_Event(MOUSEEVENTF_MOVE, 100, 100, 0, 0)
What happens is that instead of moving to location (740, 612) the mouse goes
to location (640, 612). The dx argument somehow is not understood.
Can anyone tell me what else I can do? Or is there an equivalent .net
function that is available to do the same thing instead of using user32 API.
Thanks for the help,
Glenn