home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / axnteven / frdetail.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-26  |  7.7 KB  |  250 lines

  1. VERSION 5.00
  2. Begin VB.Form FrmDetails 
  3.    Caption         =   "Event details"
  4.    ClientHeight    =   5535
  5.    ClientLeft      =   4245
  6.    ClientTop       =   2970
  7.    ClientWidth     =   5865
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5535
  10.    ScaleWidth      =   5865
  11.    StartUpPosition =   2  'CenterScreen
  12.    Begin VB.CommandButton cmdPrev 
  13.       Caption         =   "Previous"
  14.       Height          =   375
  15.       Left            =   2280
  16.       TabIndex        =   22
  17.       Top             =   5100
  18.       Width           =   1035
  19.    End
  20.    Begin VB.CommandButton btnNext 
  21.       Caption         =   "Next"
  22.       Height          =   375
  23.       Left            =   3540
  24.       TabIndex        =   21
  25.       Top             =   5100
  26.       Width           =   1035
  27.    End
  28.    Begin VB.CommandButton btnClose 
  29.       Caption         =   "Close"
  30.       Default         =   -1  'True
  31.       Height          =   375
  32.       Left            =   4800
  33.       TabIndex        =   20
  34.       Top             =   5100
  35.       Width           =   1035
  36.    End
  37.    Begin VB.TextBox memData 
  38.       BackColor       =   &H80000004&
  39.       Height          =   1035
  40.       Left            =   0
  41.       Locked          =   -1  'True
  42.       MultiLine       =   -1  'True
  43.       ScrollBars      =   2  'Vertical
  44.       TabIndex        =   19
  45.       Top             =   3900
  46.       Width           =   5835
  47.    End
  48.    Begin VB.TextBox memDesription 
  49.       BackColor       =   &H80000004&
  50.       Height          =   1815
  51.       Left            =   0
  52.       Locked          =   -1  'True
  53.       MultiLine       =   -1  'True
  54.       ScrollBars      =   2  'Vertical
  55.       TabIndex        =   17
  56.       Top             =   1680
  57.       Width           =   5835
  58.    End
  59.    Begin VB.Label Label10 
  60.       Caption         =   "Data"
  61.       Height          =   195
  62.       Left            =   60
  63.       TabIndex        =   18
  64.       Top             =   3660
  65.       Width           =   1815
  66.    End
  67.    Begin VB.Label Label9 
  68.       Caption         =   "Description"
  69.       Height          =   195
  70.       Left            =   60
  71.       TabIndex        =   16
  72.       Top             =   1440
  73.       Width           =   1815
  74.    End
  75.    Begin VB.Label lblCategory 
  76.       Caption         =   "lblCategory"
  77.       Height          =   195
  78.       Left            =   4020
  79.       TabIndex        =   15
  80.       Top             =   1020
  81.       Width           =   1815
  82.    End
  83.    Begin VB.Label Label8 
  84.       Caption         =   "Category:"
  85.       Height          =   195
  86.       Left            =   2940
  87.       TabIndex        =   14
  88.       Top             =   1020
  89.       Width           =   795
  90.    End
  91.    Begin VB.Label lblType 
  92.       Caption         =   "lblType"
  93.       Height          =   195
  94.       Left            =   4020
  95.       TabIndex        =   13
  96.       Top             =   720
  97.       Width           =   1815
  98.    End
  99.    Begin VB.Label Label7 
  100.       Caption         =   "Type:"
  101.       Height          =   195
  102.       Left            =   2940
  103.       TabIndex        =   12
  104.       Top             =   720
  105.       Width           =   795
  106.    End
  107.    Begin VB.Label lblSource 
  108.       Caption         =   "lblSource"
  109.       Height          =   195
  110.       Left            =   4020
  111.       TabIndex        =   11
  112.       Top             =   420
  113.       Width           =   1815
  114.    End
  115.    Begin VB.Label Label6 
  116.       Caption         =   "Source:"
  117.       Height          =   195
  118.       Left            =   2940
  119.       TabIndex        =   10
  120.       Top             =   420
  121.       Width           =   795
  122.    End
  123.    Begin VB.Label lblEventID 
  124.       Caption         =   "lblEventID"
  125.       Height          =   195
  126.       Left            =   4020
  127.       TabIndex        =   9
  128.       Top             =   120
  129.       Width           =   1815
  130.    End
  131.    Begin VB.Label Label5 
  132.       Caption         =   "Event ID:"
  133.       Height          =   195
  134.       Left            =   2940
  135.       TabIndex        =   8
  136.       Top             =   120
  137.       Width           =   795
  138.    End
  139.    Begin VB.Label lblComputer 
  140.       Caption         =   "lblComputer"
  141.       Height          =   195
  142.       Left            =   960
  143.       TabIndex        =   7
  144.       Top             =   1020
  145.       Width           =   1815
  146.    End
  147.    Begin VB.Label Label4 
  148.       Caption         =   "Computer:"
  149.       Height          =   195
  150.       Left            =   60
  151.       TabIndex        =   6
  152.       Top             =   1020
  153.       Width           =   795
  154.    End
  155.    Begin VB.Label lblUser 
  156.       Caption         =   "lblUser"
  157.       Height          =   195
  158.       Left            =   960
  159.       TabIndex        =   5
  160.       Top             =   720
  161.       Width           =   1815
  162.    End
  163.    Begin VB.Label Label3 
  164.       Caption         =   "User:"
  165.       Height          =   195
  166.       Left            =   60
  167.       TabIndex        =   4
  168.       Top             =   720
  169.       Width           =   615
  170.    End
  171.    Begin VB.Label lblTime 
  172.       Caption         =   "lblTime"
  173.       Height          =   195
  174.       Left            =   960
  175.       TabIndex        =   3
  176.       Top             =   420
  177.       Width           =   1875
  178.    End
  179.    Begin VB.Label Label2 
  180.       Caption         =   "Time:"
  181.       Height          =   195
  182.       Left            =   60
  183.       TabIndex        =   2
  184.       Top             =   420
  185.       Width           =   615
  186.    End
  187.    Begin VB.Label lblDate 
  188.       Caption         =   "lblDate"
  189.       Height          =   195
  190.       Left            =   960
  191.       TabIndex        =   1
  192.       Top             =   120
  193.       Width           =   1815
  194.    End
  195.    Begin VB.Label Label1 
  196.       Caption         =   "Date:"
  197.       Height          =   195
  198.       Left            =   60
  199.       TabIndex        =   0
  200.       Top             =   120
  201.       Width           =   615
  202.    End
  203. Attribute VB_Name = "FrmDetails"
  204. Attribute VB_GlobalNameSpace = False
  205. Attribute VB_Creatable = False
  206. Attribute VB_PredeclaredId = True
  207. Attribute VB_Exposed = False
  208. Private Sub ReadEvent(AIndex As Integer)
  209.   Set Obj = FrmLog.NTEventLogX.Objects(AIndex)
  210.   lblDate.Caption = Format(Obj.TimeWritten, "dd-mmm-yyyy")
  211.   lblTime.Caption = Format(Obj.TimeWritten, "hh:nn:ss")
  212.   lblSource.Caption = Obj.SourceName
  213.   lblCategory.Caption = Format(Obj.EventCategory, "0")
  214.   If Obj.EventId < 0 Then J = 65536 - (Abs(Obj.EventId) Mod 65536) Else J = Obj.EventId Mod 65536
  215.   lblEventID.Caption = Format(J, "00000")
  216.   lblUser.Caption = Obj.UserName
  217.   lblComputer.Caption = Obj.ComputerName
  218.   If Obj.EventType = EVT_SUCCESS Then lblType.Caption = "Success"
  219.   If Obj.EventType = EVT_ERROR Then lblType.Caption = "Error"
  220.   If Obj.EventType = EVT_WARNING Then lblType.Caption = "Warning"
  221.   If Obj.EventType = EVT_INFORMATION Then lblType.Caption = "Information"
  222.   If Obj.EventType = EVT_AUDIT_SUCCESS Then lblType.Caption = "Audit success"
  223.   If Obj.EventType = EVT_AUDIT_FAILURE Then lblType.Caption = "Audit Failure"
  224.   memDesription.Text = FrmLog.NTEventLogX.Items(AIndex)
  225.   memData.Text = ""
  226.   Set DataBytes = Obj.DataBytes
  227.   For i = 0 To DataBytes.Count - 1
  228.     memData.Text = memData.Text + Format(Hex(DataBytes.Item(i)), "00 ")
  229.   Next i
  230. End Sub
  231. Private Sub btnClose_Click()
  232.   Unload FrmDetails
  233. End Sub
  234. Private Sub btnNext_Click()
  235.   If FrmLog.lbxEvents.ListIndex < FrmLog.lbxEvents.ListCount Then
  236.     FrmLog.lbxEvents.ListIndex = FrmLog.lbxEvents.ListIndex + 1
  237.     Form_Load
  238.   End If
  239. End Sub
  240. Private Sub cmdPrev_Click()
  241.   If FrmLog.lbxEvents.ListIndex > 0 Then
  242.     FrmLog.lbxEvents.ListIndex = FrmLog.lbxEvents.ListIndex - 1
  243.     Form_Load
  244.   End If
  245. End Sub
  246. Private Sub Form_Load()
  247.   If FrmLog.mniOldest.Checked Then ReadEvent (FrmLog.lbxEvents.ListIndex)
  248.   If FrmLog.mniNewest.Checked Then ReadEvent (FrmLog.NTEventLogX.Count - FrmLog.lbxEvents.ListIndex - 1)
  249. End Sub
  250.