Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetCursorPos() - a simple question
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01067213
Message ID:
01067300
Views:
27
Closer...

But it returns the position relative to the VFP main screen, not the active form... what am i missing?
procedure getCoord
parameters xcoord,ycoord

Local lcPOINT

DECLARE INTEGER GetCursorPos IN Win32API ;
	STRING@
Declare Long ScreenToClient in User32 Long hWnd, String @cPoint

Declare integer GetActiveWindow in WIN32API

lcPOINT = SPACE(8)

HWnd = GetActiveWindow()

ret = GetCursorPos(@lcPOINT)
=ScreenToClient( hWnd, @lcPoint )
IF ret == 0
	XCoord	= MCOL(3)
	YCoord	= MROW(3)
ELSE
	XCoord	= ASC(LEFT(m.lcPOINT,1))+256*ASC(SUBSTR(m.lcPOINT,2,1))
	YCoord	= ASC(SUBSTR(m.lcPOINT,5,1))+256*ASC(SUBSTR(m.lcPOINT,6,1))
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform