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:
01067308
Views:
22
Try FindWindow() or upgrade to VFP9 so you can use hWnd property of a form.

>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
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform