Jump to Real's How-to Main page

Move the mouse cursor

[structure definition for GetCursorPos function, str_point]
posx  long
posy  long

[local external function declaration]
FUNCTION boolean SetCursorPos(int cx, int cy)  LIBRARY "User32.dll"
FUNCTION boolean GetCursorPos(ref str_point POINT)  LIBRARY "User32.dll"

[clicked event of a button]
int i
str_point lstr_point

GetCursorPos(lstr_point)
FOR i = 0 TO 100
  SetCursorPos(lstr_point.posx + i , lstr_point.posy + i)
NEXT

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]