Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'Dans un module Dim Temp As String 'Add this code to a module Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean Dim sSave As String, Ret As Long Ret = GetWindowTextLength(hwnd) sSave = Space(Ret) GetWindowText hwnd, sSave, Ret + 1 If sSave <> vbNullString And IsWindowVisible(hwnd) Then Temp = Temp & sSave & vbCrLf 'continue enumeration EnumWindowsProc = True End Function Public Function App_Ouverte() EnumWindows AddressOf EnumWindowsProc, ByVal 0& App_Ouverte = Temp End Function
MsgBox App_Ouverte
Dim ouverte() As String Private Sub Form_Load() ouverte = Split(App_Ouverte, vbCrLf) End Sub Private Sub Timer1_Timer() 'mise a jour de list1 selon la liste de depart des appli ouverte List1.Clear Dim temp() As String Erase temp temp = Split(App_Ouverte, vbCrLf) Dim Existe As Boolean Existe = False For i = 0 To UBound(temp) For a = 0 To UBound(ouverte) If temp(i) ouverte(a) Then Existe True: Exit For Next a If Not Existe Then List1.AddItem temp(i) Existe = False Next i End Sub