For Each p As Process In Process.GetProcesses() If Not p.MainWindowHandle = Nothing Then Debug.Print("---") Debug.Print(p.MainWindowHandle.ToString) Debug.Print(p.MainWindowTitle) End If Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim vvkey As Long = GetKeyState(&H41) If vvkey <> 0 And vvkey <> 1 Then '' F12 keybd_event(&H8, TheForm, 0&, 0&) keybd_event(&H64, TheForm, 0&, 0&) fonction retourne 0 ou 1 lorsque la touche est inactive sinon -128 ou -127 lorsque la touche est enfoncée. End If
Private Declare Sub keybd_event Lib "user32" Alias "keybd_event" ( _ ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim VK_ACTION As Long VK_ACTION = &H45 Call keybd_event(VK_ACTION, 0, 0, 0) Call keybd_event(VK_ACTION, 0, 2, 0) End Sub
Declare Sub keybd_event Lib "user32" Alias "keybd_event" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim vvkey As Long = GetKeyState(&H41) If vvkey <> 0 And vvkey <> 1 Then '' F12 keybd_event(&H8, 0, 0&, 0&) Thread.Sleep(20) keybd_event(&H64, 0, 0&, 0&) End If End Sub
Declare Sub keybd_event Lib "user32" Alias "keybd_event" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Focus()''Donne le focus au textbox keybd_event(&H8, 0, 0&, 0&)''envoie la keybd_event(&H64, 0, 0&, 0&)''touche '1' End Sub