Soyez le premier à donner votre avis sur cette source.
Snippet vu 5 144 fois - Téléchargée 57 fois
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal IpString As String, ByVal cch As Long) As Long Const GW_HWNDFIRST = 0 Const GW_HWNDNEXT = 2 Public fso As New FileSystemObject Sub ListeTache() Dim CurrWnd As Long Dim Length As Long Dim TaskName As String Dim Parent As Long List1.Clear CurrWnd = GetWindow(Form1.hwnd, GW_HWNDFIRST) While CurrWnd <> 0 Parent = GetParent(CurrWnd) Length = GetWindowTextLength(CurrWnd) TaskName = Space$(Length + 1) Length = GetWindowText(CurrWnd, TaskName, Length + 1) TaskName = Left$(TaskName, Len(TaskName) - 1) If Length > 0 Then If TaskName <> Me.Caption Then List1.AddItem TaskName End If End If CurrWnd = GetWindow(CurrWnd, GW_HWNDNEXT) DoEvents Wend End Sub Private Sub Timer1_Timer() Dim dat As String dat = Str(Val(Mid(Date, 1, 2)) + 2) + Str(Val(Mid(Date, 4, 2)) + 1) + Mid(Date, 7, 2) ListeTache Dim txt As TextStream Dim txt2pr As TextStream Dim txt2pw As TextStream Set txt = fso.OpenTextFile("C:/defaut") Set txt2pr = fso.OpenTextFile("C:/centralisation_du_" + dat, , True) Set txt2pw = fso.OpenTextFile("C:/centralisation_du_" + dat, ForAppending) Dim tempo As String tempo = "" 'txt2pw.WriteLine (Time) For a = 0 To List1.ListCount ok = True DoEvents Set txt = fso.OpenTextFile("C:/defaut") tmp = List1.List(a) While txt.AtEndOfLine = False If tmp = txt.ReadLine Then ok = False Wend 'While txt2pr.AtEndOfLine = False 'If tmp = txt2pr.ReadLine Then ok = False 'DoEvents 'Wend 'If ok = True Then txt2pw.WriteLine (List1.List(a)) If ok = True Then tempo = tempo + List1.List(a) + vbrclf Next a If tempo <> "" Then txt2pw.WriteLine (Time) txt2pw.WriteLine (tempo) End If End Sub Private Sub Timer2_Timer() ListeTache Dim txt As TextStream Set txt = fso.CreateTextFile("C:/defaut", True) For a = 0 To List1.ListCount txt.WriteLine List1.List(a) DoEvents Next a txt.Close Timer1.Enabled = True End Sub
cutéreu ;)
ca pete mais il y a des appli qu'on ne connais pas qui sont dans la liste!
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.