Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object only visible while F-key held down
Message
De
12/06/2002 14:37:00
 
 
À
12/06/2002 07:54:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00667279
Message ID:
00667573
Vues:
22
Another possibility is to call the WinAPI function GetAsyncKeyState to see what keys are pressed. The advantage of this method is you can check to see if a combination of CTRL-ALT-SHIFT are held down, since any other key will be putting keystrokes in the keyboard buffer. This solution would also use a timer as Hilmar suggested, but the timer would be running continuously.

For example, if you look for the SHIFT-CTRL combination, the code would look like this:

Form.LOAD
DECLARE SHORT GetAsyncKeyState IN USER32.DLL INTEGER
Timer.Timer
    IF GetAsyncKeyState(0x10)  <> 0 ;	&& shift key pressed
        and GetAsyncKeyState(0x11) <> 0  && ctrl key pressed

        * If controls are hidden, make them visible here
    ELSE
        * If controls are visible, hide them here.
    ENDIF
A list of the available keycodes is here.

-Tom

[This posting is provided "AS IS" with no warranties, and confers no rights.]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform