cs_Rolrol
Messages postés7Date d'inscriptiondimanche 10 novembre 2002StatutMembreDernière intervention 5 décembre 2006
-
20 févr. 2003 à 17:35
cs_Rolrol
Messages postés7Date d'inscriptiondimanche 10 novembre 2002StatutMembreDernière intervention 5 décembre 2006
-
21 févr. 2003 à 09:02
Comment simuler la pression de la touche windows gauche a partir d'un command button ???
J'ai essayer avec sendkeys ça ne fonctionne pas.
Merci de votre aide
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 201311 21 févr. 2003 à 00:13
Bonsoir. On peut utiliser le Sub keybd_event de l'API Windows
Dans Général - Déclarations :
Const VK_wingauche = &H5B
Const VK_windroite = &H5C
Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
et si le bouton s'appelle Command1,
Private Sub Command1_Click()
keybd_event VK_wingauche, 0, 0, 0 ' appui sur la touche Windows gauche
keybd_event VK_wingauche, 0, KEYEVENTF_KEYUP, 0 ' relache la touche Windows gauche
End Sub