Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Get Currext X, and Current Y positions of CURSOR
Message
From
11/08/1999 03:59:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251346
Message ID:
00252382
Views:
8
>>>Hi All,
>>>
>>> I want to know the current positions of my cursor in screen. (not in form or text box). How can i get it. On that basis i wanted to show my next form i.e. it should not come over my current cursor.
>>>
>>>Regards
>>>Amit
>>Amit,
>>Assuming your form's scalemode set to pixels this could help you as a starter :
with _Screen.Activeform.ActiveControl
>> lnWidth = txtwidth(substr(.Text,1,.selstart+1), .FontName, .FontSize)*Fontmetric(6,.FontName, .FontSize)
>> lnPosX = objtoclient(_Screen.Activeform.ActiveControl,2) + lnWidth
>> lnPosY = objtoclient(_Screen.Activeform.ActiveControl,1) + .height
>>endwith
Cetin
>
>Cetin,
>
>Unfortunately, I've discovered that no all controls that might be of interest have a SelStart; the API call GetCaretPos() is the only way that I've found to retrieve it, and the return is in client coordinates, so there's more translation involved.

Right Ed only 4 controls have it. It's a starter :) For others I think using T,L,H,W would be sufficient.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform