1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Public Declare Sub Sleep Lib "kernel32" (ByVal dwmiliseconds As Long)
Public Const INFINITE = &HFFFFFFFF
Public Const SYNCHRONIZE = &H100000
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Sub Zip()
Dim pid As Long
Dim phnd As Long
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Main.Variables_globales.URL_LOG) Then
If FileLen(Main.Variables_globales.URL_LOG) > Main.Variables_globales.TAILLE Then
Call Gestion_Log("Zip fichier", "Zip")
pid = Shell("C:\Windows\System32\cmd.exe /Cc:\Convertisseur_ZIP.bat")
If pid <> 0 Then
phnd = OpenProcess(SYNCHRONIZE, 0, pid)
If phnd <> 0 Then
Call WaitForSingleObject(phnd, INFINITE)
Call CloseHandle(phnd)
End If
End If
End If
Else
Set fs = CreateObject("Scripting.FileSystemObject")
Set A = fs.CreateTextFile(Main.Variables_globales.URL_LOG, True)
End If
End Sub |
Partager