Information générale
Catégorie:
Fonctions Windows API
Peter-
Perhaps this isn't the best approach? I'd hesitate to disable keys, and you may not need to in this case.
Enter: If the second press of Enter is again triggering the default button, can your method (called from the Click() code) perhaps switch focus (not to another button), turn off the Default property on the button, do its stuff, and then reinstate the Default property? Of course this isn't foolproof, but it sounds like it might address what's happening here.
Esc: It sounds like you don't have the Cancel property of any button set. What you can do is, in the above paragraph, also disable Esc using Set Escape Off and reinstate it at the end of the process. On the other hand, if you are using cmdSomeButton.Cancel = .T., set that to .F. during your processing.
Hope that helps ...
zahid
>Does someone know how to disable ESC and Enter in the keyboard using Win API ?
>Problem: user presses Enter (default) button to fast and it hangs a method called by click event and in other case user press ESC and interrupt the execution.
>I just want to disable the Enter and Esc keyboard buttons during 5 seconds, then enable those buttons again.
>
>Thanks in advance !
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