Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement