Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim lHandle as long
dim lRecs as long
dim lRet as long
dim sServer as string
dim sSource as string
sSource = "Application" 'event source you are interested in
sServer = "." 'Server name . for local machine
lHandle = OpenEventLog(sServer, sSource)
'check handle is valid i.e. > 0
' Read number of records
lRet = GetNumberofEventLogRecords(lHandle, lRecs)
'check success i.e. lRet > 0
'Read record into EVENTLOGRECORD udt
'this is the tricky bit as the record size is variable
' and you will need to improve this code SUBSTANTIALLY
'because it reads 1 record into a fixed buffer very ineffecient
dim lBytes1 as long, lBytes2 as long, lBytes3 as long
dim udtRecs as EVENTLOGRECORD
lBytes1 = 4096
lRet = ReadEventLog(lHandle, EVENTLOG_FORWARDS_READ + EVENTLOG_SEQUENTIAL_READ,0,udtRecs, lBytes1, lBytes2, lBytes3)
'that is really nasty..
' you will need to convert the times from UTC something easier to manipulate e.g.double or variant date
'You will alos need to locate the message dll, which will
'be stored in HKLM\system\currentcontrolset\services' eventlog\<source>\eventmessagefile
'
' You need to load this file using LoadLibraryEx
' and then use the formatmessageapi to convert the event id
' to the relevant string
'