Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Get Currext X, and Current Y positions of CURSOR
Message
De
10/08/1999 09:17:38
 
 
À
10/08/1999 05:24:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00251346
Message ID:
00251922
Vues:
10
>>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform