Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can a mouse click be detected outside of a modal form
Message
 
À
27/10/2006 14:47:58
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01164759
Message ID:
01165173
Vues:
24
>>Mike,
>>
>>Then probably you have lostfocus or deactivate event in your control or form. If so, then probably you may check there for mdown() and if yes, then you may try to check the coordinates of the mouse cursor.
>
>I do have code in the form.lostfocus event. I'm finding that the lostfocus event does not fire for a modal form. Am I doing something wrong?

Mike,

I do not think that you do something wrong. It is how the modal form and control on it work. Because of this the mdown() function probably will not work also outside the form.

Actually what you need is to check the mouse status and position while the modal form exists, and if the mouse status is down and it is positioning outside the form, then call form.release event. For this you would need to add the timer to the form, and use the appropriate WINAPI functions. I know that GetCursorPos is suitable for getting mouse coordinates. As of the mouse status, then probably, it is GetCursorInfo, but I do not know exactly.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform