Private Type EVENTLOGRECORD (中略) End Type Private Declare Function OpenEventLog Lib ... Private Declare Function ReadEventLog Lib ... Private Declare Function CloseEventLog Lib ...
Public Sub main() Dim hwnd As Long Dim pbuf As EVENTLOGRECORD Dim bufAddr As Long Dim BufSize As Long Dim ReadBytes As Long Dim NextSize As Long Dim Ret as Boolean hwnd = OpenEventLog("PC名", "Application") BufSize = 1 Ret = ReadEventLog(hwnd, 4, 0, pbuf, BufSize, ReadBytes, NextSize) ここ!
Private Declare Function OpenEventLog Lib "advapi32.dll" Alias "OpenEventLogA" (ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Long
Private Declare Function ReadEventLog Lib "advapi32.dll" Alias "ReadEventLogA" (ByVal hEventLog As Long, ByVal dwReadFlags As Long, ByVal dwRecordOffset As Long, ByRef lpBuffer As EVENTLOGRECORD, ByVal nNumberOfBytesToRead As Long, ByRef pnBytesRead As Long, ByRef pnMinNumberOfBytesNeeded As Long) As Long
Private Declare Function CloseEventLog Lib "advapi32.dll" (ByVal hEventLog As Long) As Long