VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Advanced Windows NT Eventlogger

Holger Sauer  (1 Submission)   Windows API Call/Explanation   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

A VB6 class file that allows to easily write messages - even with more than one parameter (best used with additional messagetable in resource DLL) to the windows eventlog.

Inputs
type and content of a message to be logged to the eventlog

API Declarations
Private Declare Function RegisterEventSource Lib "advapi32.dll" Alias "RegisterEventSourceA" (ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Long
Private Declare Function DeregisterEventSource Lib "advapi32.dll" (ByVal hEventLog As Long) As Long
Private Declare Function ReportEvent Lib "advapi32.dll" Alias "ReportEventA" (ByVal hEventLog As Long, ByVal wType As Integer, ByVal wCategory As Integer, ByVal dwEventID As Long, ByVal lpUserSid As Any, ByVal wNumStrings As Integer, ByVal dwDataSize As Long, plpStrings As Long, lpRawData As Any) As Boolean
Private Declare Function GetLastError Lib "kernel32" () As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Const EVENTLOG_SUCCESS = 0
Private Const EVENTLOG_ERROR_TYPE = &H1
Private Const EVENTLOG_WARNING_TYPE = &H2
Private Const EVENTLOG_INFORMATION_TYPE = &H4
Private Const EVENTLOG_AUDIT_SUCCESS = 8
Private Const EVENTLOG_AUDIT_FAILURE = 10

Rate Advanced Windows NT Eventlogger (5(5 Vote))

Download Advanced Windows NT Eventlogger

Advanced Windows NT Eventlogger Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters