Code: Select all
; ** Facility codes.
#FACILITY_SYSTEM = $0
#FACILITY_STUBS = $3
#FACILITY_RUNTIME = $2
#FACILITY_IO_ERROR_CODE = $4
; ** Severity codes.
#STATUS_SEVERITY_WARNING = $2
#STATUS_SEVERITY_SUCCESS = $0
#STATUS_SEVERITY_INFORMATIONAL = $1
#STATUS_SEVERITY_ERROR = $3
; ** Event Types
#EVENTLOG_SUCCESS = $0000 ; Information event
#EVENTLOG_AUDIT_FAILURE = $0010 ; Failure Audit event
#EVENTLOG_AUDIT_SUCCESS = $0008 ; Success Audit event
#EVENTLOG_ERROR_TYPE = $0001 ; Error event
#EVENTLOG_INFORMATION_TYPE = $0004 ; Information event
#EVENTLOG_WARNING_TYPE = $0002 ; Warning event
sourceName.s = "NetTax" ; The event source name.
dwEventID.w = 0 ; The event identifier.
cInserts.w = 1 ; The count of insert strings.
szMsg.s = "insertString" ; The insert strings.
evHdl = RegisterEventSource_(#Null, sourceName)
If evHdl = #Null
MessageRequester("", "Couldn't register event source")
EndIf
Result = ReportEvent_(evHdl, #EVENTLOG_SUCCESS, 0, dwEventID, #Null, cInserts, 0, @szMsg, #Null)
If Result = 0
MessageRequester("", "Couldn't report the event. Failed with error " + Str(GetLastError_()))
EndIf
DeregisterEventSource_(evHdl) All the other examples arround the forum, do not write the message.
So the chalenge is... Can anyone get a snipet of code that enters an enter in the eventlog in windows vista?



