Windows API Calls for Powerbuilder 5.0

¹®Á¦

GetCursorPos( ) & SetCursorPos( )

ÇØ°á

This function returns the x and y position of the cursor into a structure. SetCursorPos moves the cursor to the coordinates it receives. There is no Powerbuilder equivalent.

Global External Function:
FUNCTION boolean GetCursorPos(ref mousepos mousepos2) LIBRARY "User32.dll"
FUNCTION boolean SetCursorPos(int cx, int cy) LIBRARY "User32.dll"

Structure: (Mousepos)
long xpos, long ypos

Script:
mousepos mouseloc
GetCursorPos(mouseloc)
Messagebox("Cursor Position", "X = " + string(mouseloc.xpos) + &
                                     " : Y = " + string(mouseloc.ypos))
SetCursorPos(300,350)
Messagebox("Cursor Position",  "X = "+ string(mouseloc.xpos) + &
                                        " : Y = "+ string(mouseloc.ypos))

 

ÂüÁ¶