Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetCursorPos() - a simple question
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
GetCursorPos() - a simple question
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01067213
Message ID:
01067213
Vues:
113
Hi all,

a simple question,
I want to get the x , y position of the cursor.
I'm using GetCursorPos() but it retrieves the position relative to the screen, and I need the position relative to the active window.

thanks!
fabian
parameters ln_xcor,ln_ycor

DECLARE Integer GetCursorPos IN user32.dll String @


#define BYTE_1 1
#define BYTE_2 256
#define BYTE_3 65536
#define BYTE_4 16777216

lcbuffer = SPACE(8)
fResult = GetCursorPos(@lcbuffer)

ln_xcor = (ASC(SUBSTR(lcBuffer, 1, 1)) * BYTE_1) + (ASC(SUBSTR(lcBuffer, 2, 1)) * BYTE_2) + (ASC(SUBSTR(lcBuffer, 3, 1)) * BYTE_3) + (ASC(SUBSTR(lcBuffer, 4, 1)) * BYTE_4) 
					  
ln_ycor = (ASC(SUBSTR(lcBuffer, 5, 1)) * BYTE_1) + (ASC(SUBSTR(lcBuffer, 6, 1)) * BYTE_2) + (ASC(SUBSTR(lcBuffer, 7, 1)) * BYTE_3) + (ASC(SUBSTR(lcBuffer, 8, 1)) * BYTE_4)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform