Postup:
Do deklaraΦnφ Φßsti
formulß°e zapiÜte:
Private Declare Function BackupEventLog Lib "advapi32.dll" Alias
"BackupEventLogA" ( _
ByVal hEventLog As Long, _
ByVal lpBackupFileName As String) _
As Long
Private Declare Function CloseEventLog Lib "advapi32.dll" ( _
ByVal hEventLog As Long) _
As Long
Private Declare Function OpenEventLog Lib "advapi32.dll" _
Alias "OpenEventLogA" ( _
ByVal lpUNCServerName As String, _
ByVal lpSourceName As String) _
As Long
Na formulß° p°idejte tlaΦφtko
a na jeho udßlost click:
Private Sub Command1_Click()
Dim hEventLog As Long
Dim lretv As Long
hEventLog = OpenEventLog(vbNullString, "Application")
If hEventLog = 0 Then
Debug.Print "Chyba p°i otevφrßnφ
EventLogu"
Exit Sub
Else
Debug.Print "Otev°enφ EventLogu"
End If
lretv = BackupEventLog(hEventLog, "c:\appback.evt")
If lretv = 0 Then
Debug.Print "Chyba p°i zßloze
EventLogu"
Exit Sub
Else
Debug.Print "Zßloha prob∞hla ·sp∞Ün∞"
End If
lretv = CloseEventLog(hEventLog)
If lretv = 0 Then
Debug.Print "Chyba p°i zavφrßnφ
EventLogu"
Exit Sub
Else
Debug.Print "Zav°enφ EventLogu"
End If
End Sub
|