home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Computer_I53337252002.psc / main.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-02-06  |  25.0 KB  |  703 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  5. Begin VB.Form main 
  6.    Caption         =   "Hardware Information - By JMC_CompGuy"
  7.    ClientHeight    =   6810
  8.    ClientLeft      =   90
  9.    ClientTop       =   1395
  10.    ClientWidth     =   10860
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   6810
  15.    ScaleWidth      =   10860
  16.    Begin VB.Frame Frame4 
  17.       Caption         =   "Computer Information"
  18.       Height          =   2025
  19.       Left            =   4950
  20.       TabIndex        =   15
  21.       Top             =   0
  22.       Width           =   5865
  23.       Begin TabDlg.SSTab SSTab2 
  24.          Height          =   1755
  25.          Left            =   60
  26.          TabIndex        =   16
  27.          Top             =   210
  28.          Width           =   5745
  29.          _ExtentX        =   10134
  30.          _ExtentY        =   3096
  31.          _Version        =   393216
  32.          Style           =   1
  33.          Tab             =   2
  34.          TabHeight       =   520
  35.          TabMaxWidth     =   882
  36.          TabCaption(0)   =   "Operating System"
  37.          Tab(0).ControlEnabled=   0   'False
  38.          Tab(0).Control(0)=   "lblProductName"
  39.          Tab(0).Control(1)=   "lblVersion"
  40.          Tab(0).Control(2)=   "lblCSDVersion"
  41.          Tab(0).Control(3)=   "lblProductID"
  42.          Tab(0).Control(4)=   "lblROwner"
  43.          Tab(0).Control(5)=   "lblROrganization"
  44.          Tab(0).ControlCount=   6
  45.          TabCaption(1)   =   "Processor"
  46.          Tab(1).ControlEnabled=   0   'False
  47.          Tab(1).Control(0)=   "lblSysID"
  48.          Tab(1).Control(1)=   "lblVendorID"
  49.          Tab(1).Control(2)=   "lblProcessorName"
  50.          Tab(1).Control(3)=   "lblIdentifier"
  51.          Tab(1).Control(4)=   "lblMHz"
  52.          Tab(1).ControlCount=   5
  53.          TabCaption(2)   =   "BIOS (System, Video)"
  54.          Tab(2).ControlEnabled=   -1  'True
  55.          Tab(2).Control(0)=   "lblBiosDate"
  56.          Tab(2).Control(0).Enabled=   0   'False
  57.          Tab(2).Control(1)=   "lblBiosVersion"
  58.          Tab(2).Control(1).Enabled=   0   'False
  59.          Tab(2).Control(2)=   "lblVidBiosVersion"
  60.          Tab(2).Control(2).Enabled=   0   'False
  61.          Tab(2).Control(3)=   "lblVidBiosDate"
  62.          Tab(2).Control(3).Enabled=   0   'False
  63.          Tab(2).Control(4)=   "Label1"
  64.          Tab(2).Control(4).Enabled=   0   'False
  65.          Tab(2).Control(5)=   "Label2"
  66.          Tab(2).Control(5).Enabled=   0   'False
  67.          Tab(2).ControlCount=   6
  68.          Begin VB.Label Label2 
  69.             AutoSize        =   -1  'True
  70.             Caption         =   "Video BIOS:"
  71.             Height          =   195
  72.             Left            =   30
  73.             TabIndex        =   33
  74.             Top             =   990
  75.             Width           =   870
  76.          End
  77.          Begin VB.Label Label1 
  78.             AutoSize        =   -1  'True
  79.             Caption         =   "System BIOS:"
  80.             Height          =   195
  81.             Left            =   60
  82.             TabIndex        =   32
  83.             Top             =   360
  84.             Width           =   975
  85.          End
  86.          Begin VB.Label lblVidBiosDate 
  87.             AutoSize        =   -1  'True
  88.             Height          =   195
  89.             Left            =   120
  90.             TabIndex        =   31
  91.             Top             =   1410
  92.             Width           =   45
  93.          End
  94.          Begin VB.Label lblVidBiosVersion 
  95.             AutoSize        =   -1  'True
  96.             Height          =   195
  97.             Left            =   120
  98.             TabIndex        =   30
  99.             Top             =   1200
  100.             Width           =   45
  101.          End
  102.          Begin VB.Label lblBiosVersion 
  103.             AutoSize        =   -1  'True
  104.             Height          =   195
  105.             Left            =   120
  106.             TabIndex        =   29
  107.             Top             =   570
  108.             Width           =   45
  109.          End
  110.          Begin VB.Label lblBiosDate 
  111.             AutoSize        =   -1  'True
  112.             Height          =   195
  113.             Left            =   120
  114.             TabIndex        =   28
  115.             Top             =   780
  116.             Width           =   45
  117.          End
  118.          Begin VB.Label lblSysID 
  119.             AutoSize        =   -1  'True
  120.             Height          =   195
  121.             Left            =   -74940
  122.             TabIndex        =   27
  123.             Top             =   1200
  124.             Width           =   45
  125.          End
  126.          Begin VB.Label lblVendorID 
  127.             AutoSize        =   -1  'True
  128.             Height          =   195
  129.             Left            =   -74940
  130.             TabIndex        =   26
  131.             Top             =   360
  132.             Width           =   45
  133.          End
  134.          Begin VB.Label lblProcessorName 
  135.             AutoSize        =   -1  'True
  136.             Height          =   195
  137.             Left            =   -74940
  138.             TabIndex        =   25
  139.             Top             =   570
  140.             Width           =   45
  141.          End
  142.          Begin VB.Label lblIdentifier 
  143.             AutoSize        =   -1  'True
  144.             Height          =   195
  145.             Left            =   -74940
  146.             TabIndex        =   24
  147.             Top             =   780
  148.             Width           =   45
  149.          End
  150.          Begin VB.Label lblMHz 
  151.             AutoSize        =   -1  'True
  152.             Height          =   195
  153.             Left            =   -74940
  154.             TabIndex        =   23
  155.             Top             =   990
  156.             Width           =   45
  157.          End
  158.          Begin VB.Label lblProductName 
  159.             AutoSize        =   -1  'True
  160.             Height          =   195
  161.             Left            =   -74940
  162.             TabIndex        =   22
  163.             Top             =   360
  164.             Width           =   45
  165.          End
  166.          Begin VB.Label lblVersion 
  167.             AutoSize        =   -1  'True
  168.             Height          =   195
  169.             Left            =   -74940
  170.             TabIndex        =   21
  171.             Top             =   570
  172.             Width           =   45
  173.          End
  174.          Begin VB.Label lblCSDVersion 
  175.             AutoSize        =   -1  'True
  176.             Height          =   195
  177.             Left            =   -74940
  178.             TabIndex        =   20
  179.             Top             =   780
  180.             Width           =   45
  181.          End
  182.          Begin VB.Label lblProductID 
  183.             AutoSize        =   -1  'True
  184.             Height          =   195
  185.             Left            =   -74940
  186.             TabIndex        =   19
  187.             Top             =   990
  188.             Width           =   45
  189.          End
  190.          Begin VB.Label lblROwner 
  191.             AutoSize        =   -1  'True
  192.             Height          =   195
  193.             Left            =   -74940
  194.             TabIndex        =   18
  195.             Top             =   1260
  196.             Width           =   45
  197.          End
  198.          Begin VB.Label lblROrganization 
  199.             AutoSize        =   -1  'True
  200.             Height          =   195
  201.             Left            =   -74940
  202.             TabIndex        =   17
  203.             Top             =   1470
  204.             Width           =   45
  205.          End
  206.       End
  207.    End
  208.    Begin MSComctlLib.ImageList ImageList1 
  209.       Left            =   5940
  210.       Top             =   6090
  211.       _ExtentX        =   1005
  212.       _ExtentY        =   1005
  213.       BackColor       =   -2147483643
  214.       ImageWidth      =   16
  215.       ImageHeight     =   16
  216.       MaskColor       =   12632256
  217.       _Version        =   393216
  218.    End
  219.    Begin VB.Frame Frame2 
  220.       Caption         =   "Computer"
  221.       Height          =   1995
  222.       Left            =   30
  223.       TabIndex        =   11
  224.       Top             =   30
  225.       Width           =   4875
  226.       Begin VB.CommandButton Command1 
  227.          Caption         =   "Get Hardware Info"
  228.          Default         =   -1  'True
  229.          Height          =   315
  230.          Left            =   3150
  231.          TabIndex        =   4
  232.          Top             =   1590
  233.          Width           =   1665
  234.       End
  235.       Begin VB.Frame Frame1 
  236.          Caption         =   "Choose A Device Type"
  237.          Height          =   615
  238.          Left            =   60
  239.          TabIndex        =   14
  240.          Top             =   210
  241.          Width           =   4755
  242.          Begin VB.ComboBox Combo1 
  243.             Height          =   315
  244.             Left            =   60
  245.             Sorted          =   -1  'True
  246.             Style           =   2  'Dropdown List
  247.             TabIndex        =   5
  248.             Top             =   210
  249.             Width           =   4635
  250.          End
  251.       End
  252.       Begin VB.Frame Frame3 
  253.          Caption         =   "Server"
  254.          Height          =   1065
  255.          Left            =   60
  256.          TabIndex        =   13
  257.          Top             =   840
  258.          Width           =   3045
  259.          Begin VB.ComboBox cmboComp 
  260.             Height          =   315
  261.             Left            =   60
  262.             Sorted          =   -1  'True
  263.             Style           =   2  'Dropdown List
  264.             TabIndex        =   2
  265.             Top             =   600
  266.             Width           =   1785
  267.          End
  268.          Begin VB.CommandButton btnFindComp 
  269.             Caption         =   "Find Computers"
  270.             Enabled         =   0   'False
  271.             Height          =   705
  272.             Left            =   1980
  273.             TabIndex        =   1
  274.             Top             =   210
  275.             Width           =   975
  276.          End
  277.          Begin VB.TextBox txtServerName 
  278.             Height          =   315
  279.             Left            =   60
  280.             TabIndex        =   0
  281.             Top             =   210
  282.             Width           =   1785
  283.          End
  284.       End
  285.       Begin VB.ComboBox cmboWinVer 
  286.          Height          =   315
  287.          Left            =   3150
  288.          Style           =   2  'Dropdown List
  289.          TabIndex        =   12
  290.          Top             =   1230
  291.          Width           =   1665
  292.       End
  293.       Begin VB.TextBox txtComputerName 
  294.          Height          =   315
  295.          Left            =   3150
  296.          TabIndex        =   3
  297.          Top             =   870
  298.          Width           =   1665
  299.       End
  300.    End
  301.    Begin TabDlg.SSTab SSTab1 
  302.       Height          =   4695
  303.       Left            =   4950
  304.       TabIndex        =   7
  305.       Top             =   2070
  306.       Width           =   5865
  307.       _ExtentX        =   10345
  308.       _ExtentY        =   8281
  309.       _Version        =   393216
  310.       Style           =   1
  311.       TabHeight       =   520
  312.       TabMaxWidth     =   882
  313.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  314.          Name            =   "Arial"
  315.          Size            =   8.25
  316.          Charset         =   0
  317.          Weight          =   400
  318.          Underline       =   0   'False
  319.          Italic          =   0   'False
  320.          Strikethrough   =   0   'False
  321.       EndProperty
  322.       TabCaption(0)   =   "Device Information"
  323.       Tab(0).ControlEnabled=   -1  'True
  324.       Tab(0).Control(0)=   "DevInfo"
  325.       Tab(0).Control(0).Enabled=   0   'False
  326.       Tab(0).ControlCount=   1
  327.       TabCaption(1)   =   "Driver Information"
  328.       Tab(1).ControlEnabled=   0   'False
  329.       Tab(1).Control(0)=   "DrvInfo"
  330.       Tab(1).ControlCount=   1
  331.       TabCaption(2)   =   "Extra Information"
  332.       Tab(2).ControlEnabled=   0   'False
  333.       Tab(2).Control(0)=   "Extra"
  334.       Tab(2).ControlCount=   1
  335.       Begin RichTextLib.RichTextBox Extra 
  336.          Height          =   4155
  337.          Left            =   -74910
  338.          TabIndex        =   8
  339.          Top             =   390
  340.          Width           =   5625
  341.          _ExtentX        =   9922
  342.          _ExtentY        =   7329
  343.          _Version        =   393217
  344.          BackColor       =   -2147483633
  345.          BorderStyle     =   0
  346.          Enabled         =   0   'False
  347.          Appearance      =   0
  348.          TextRTF         =   $"main.frx":0000
  349.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  350.             Name            =   "Arial"
  351.             Size            =   8.25
  352.             Charset         =   0
  353.             Weight          =   400
  354.             Underline       =   0   'False
  355.             Italic          =   0   'False
  356.             Strikethrough   =   0   'False
  357.          EndProperty
  358.       End
  359.       Begin RichTextLib.RichTextBox DevInfo 
  360.          Height          =   4155
  361.          Left            =   90
  362.          TabIndex        =   9
  363.          Top             =   390
  364.          Width           =   5625
  365.          _ExtentX        =   9922
  366.          _ExtentY        =   7329
  367.          _Version        =   393217
  368.          BackColor       =   -2147483633
  369.          BorderStyle     =   0
  370.          Enabled         =   0   'False
  371.          ScrollBars      =   3
  372.          Appearance      =   0
  373.          OLEDragMode     =   0
  374.          OLEDropMode     =   0
  375.          TextRTF         =   $"main.frx":0077
  376.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  377.             Name            =   "Arial"
  378.             Size            =   8.25
  379.             Charset         =   0
  380.             Weight          =   400
  381.             Underline       =   0   'False
  382.             Italic          =   0   'False
  383.             Strikethrough   =   0   'False
  384.          EndProperty
  385.       End
  386.       Begin RichTextLib.RichTextBox DrvInfo 
  387.          Height          =   4185
  388.          Left            =   -74910
  389.          TabIndex        =   10
  390.          Top             =   390
  391.          Width           =   5625
  392.          _ExtentX        =   9922
  393.          _ExtentY        =   7382
  394.          _Version        =   393217
  395.          BackColor       =   -2147483633
  396.          BorderStyle     =   0
  397.          Enabled         =   0   'False
  398.          ScrollBars      =   3
  399.          Appearance      =   0
  400.          OLEDragMode     =   0
  401.          OLEDropMode     =   0
  402.          TextRTF         =   $"main.frx":00EE
  403.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  404.             Name            =   "Arial"
  405.             Size            =   8.25
  406.             Charset         =   0
  407.             Weight          =   400
  408.             Underline       =   0   'False
  409.             Italic          =   0   'False
  410.             Strikethrough   =   0   'False
  411.          EndProperty
  412.       End
  413.    End
  414.    Begin MSComctlLib.TreeView TreeView1 
  415.       Height          =   4695
  416.       Left            =   30
  417.       TabIndex        =   6
  418.       Top             =   2070
  419.       Width           =   4875
  420.       _ExtentX        =   8599
  421.       _ExtentY        =   8281
  422.       _Version        =   393217
  423.       LabelEdit       =   1
  424.       Sorted          =   -1  'True
  425.       Style           =   7
  426.       ImageList       =   "ImageList1"
  427.       Appearance      =   1
  428.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  429.          Name            =   "Arial"
  430.          Size            =   8.25
  431.          Charset         =   0
  432.          Weight          =   400
  433.          Underline       =   0   'False
  434.          Italic          =   0   'False
  435.          Strikethrough   =   0   'False
  436.       EndProperty
  437.    End
  438. Attribute VB_Name = "main"
  439. Attribute VB_GlobalNameSpace = False
  440. Attribute VB_Creatable = False
  441. Attribute VB_PredeclaredId = True
  442. Attribute VB_Exposed = False
  443. Dim hResult As Long
  444. Private Sub btnFindComp_Click()
  445. If txtServerName = "" Then Exit Sub
  446. cmboComp.Clear
  447. cmboComp.AddItem txtServerName.Text
  448. cmboComp.AddItem "- Other -"
  449. cmboComp.Text = "- Other -"
  450. GetNetComputers txtServerName
  451. End Sub
  452. Private Sub cmboComp_Click()
  453. 'if '- Other -' is chosen, enabled the textbox for the user to type
  454. 'and set it to the current computer's name
  455. 'otherwise, disable the text box, and show the chosen computer in the textbox
  456. If cmboComp.Text = "- Other -" Then
  457.     txtComputerName.Enabled = True
  458.     txtComputerName.Text = ComputerName
  459.     txtComputerName.Enabled = False
  460.     txtComputerName.Text = cmboComp.Text
  461. End If
  462. End Sub
  463. Private Sub Command1_Click()
  464. Dim dClass As String
  465. Dim tempnode As Node, Class As String
  466. Dim OpenReg As Boolean
  467. 'open remote (or local) registry
  468. OpenReg = OpenRegistry(txtComputerName.Text)
  469. 'make sure the registry opened
  470. If OpenReg > 0 Then Exit Sub
  471. 'get the windows version
  472. GetWinVersion
  473. 'get the computer info
  474. GetComputerInfo
  475. If GetComputerInfo > 0 Then
  476.     MsgBox "You do not have sufficient permission, or there is an access error."
  477.     Exit Sub
  478. End If
  479. 'show computer information
  480. DisplayCompInfo
  481. 'get the registry keys we will use
  482. GetRegKeys
  483. 'populate the device list
  484. PopulateDeviceList
  485. 'add all device info to the treeview
  486. PopulateTree
  487. End Sub
  488. Private Sub PopulateTree()
  489. Me.MousePointer = vbHourglass 'look busy
  490. TreeView1.Nodes.Clear 'clear all nodes
  491. TreeView1.Refresh
  492. TreeView1.Visible = False 'hide so tree doesn't flicker
  493. If Combo1.ItemData(Combo1.ListIndex) = -1 Then
  494.     dClass = "All" ' if they selected All
  495.     'get class of current device type
  496.     dClass = DevTypes(Combo1.ItemData(Combo1.ListIndex)).Class
  497. End If
  498. a = FindInReg(UCase(dClass))   'returns number of devices starting at 0, ie. 1 device returns 0
  499. 'add parent nodes to the tree
  500. For x = 0 To a
  501.     On Error Resume Next 'cannot have duplicate key
  502.     Class = DeviceInfo(x).DevProps(0).PropVal
  503.     Set tempnode = TreeView1.Nodes.Add(, , Class, GetDevFriendlyName(Class), 3)
  504.     tempnode.Sorted = True 'sort the child nodes
  505. Next x
  506. 'add the child nodes, setting the key to DEVxxx where x is the device index
  507. Dim pic As Integer
  508. For x = 0 To a
  509.     If DeviceInfo(x).DevProps(13).PropVal = "" Then
  510.         pic = 1
  511.     Else
  512.         pic = 2
  513.     End If
  514.     If DeviceInfo(x).DevProps(5).PropVal = "" Then
  515.         TreeView1.Nodes.Add DeviceInfo(x).DevProps(0).PropVal, tvwChild, "Dev" & x, DeviceInfo(x).DevProps(2).PropVal, pic
  516.     Else
  517.         TreeView1.Nodes.Add DeviceInfo(x).DevProps(0).PropVal, tvwChild, "Dev" & x, DeviceInfo(x).DevProps(5).PropVal, pic
  518.     End If
  519. Next x
  520. TreeView1.Sorted = True 'make sure the tree is sorted
  521. TreeView1.Visible = True 'unhide
  522. 'if the user chose to display only one type of device, auto expand the tree
  523. If Combo1.Text <> "- All -" Then
  524.     For x = 1 To TreeView1.Nodes.Count
  525.         TreeView1.Nodes(x).Expanded = True
  526.     Next x
  527. End If
  528. Me.MousePointer = vbDefault 'return pointer to normal
  529. End Sub
  530. Private Sub Form_Load()
  531. 'set default image size
  532. ImageList1.ImageWidth = 16
  533. ImageList1.ImageHeight = 16
  534. 'load icons from resource file
  535. ImageList1.ListImages.Add , , LoadResPicture(102, vbResIcon)
  536. ImageList1.ListImages.Add , , LoadResPicture(103, vbResIcon)
  537. ImageList1.ListImages.Add , , LoadResPicture(101, vbResIcon)
  538. cmboWinVer.AddItem "95/98/ME"
  539. cmboWinVer.AddItem "NT/2000/XP"
  540. cmboWinVer.AddItem "Unknown"
  541. cmboWinVer.Text = "Unknown"
  542. cmboComp.AddItem "- Other -"
  543. cmboComp.Text = "- Other -"
  544. 'center form on screen
  545. If Screen.Width / Screen.Height > 2 Then
  546.     'pair of monitors side by side
  547.     Me.Left = ((Screen.Width / 2) - Me.Width) / 2
  548. ElseIf Screen.Width / Screen.Height < 1 Then
  549.     'pair of monitors, stacked
  550.     Me.Top = ((Screen.Height / 2) - Me.Height) / 2
  551.     'just one monitor
  552.     Me.Left = (Screen.Width - Me.Width) / 2
  553.     Me.Top = (Screen.Height - Me.Height) / 2
  554.     Me.Top = (Screen.Height - Me.Height) / 2
  555. End If
  556. 'get the computer's name
  557. txtComputerName.Text = GetCompName
  558. End Sub
  559. Private Function PopulateDeviceList()
  560. Combo1.Clear
  561. Combo1.AddItem "- All -"
  562. Combo1.ItemData(Combo1.NewIndex) = -1
  563. 'get all device types and add them to the combo box
  564. For x = 0 To GetDevTypesx - 1
  565.     If DevTypes(x).Name > "" Then
  566.         Combo1.AddItem DevTypes(x).Name
  567.     Else
  568.         Combo1.AddItem DevTypes(x).Class
  569.     End If
  570.     Combo1.ItemData(Combo1.NewIndex) = x
  571. Next x
  572. 'set combo1 to - All -
  573. Combo1.Text = "- All -"
  574. End Function
  575. Private Sub TreeView1_Click()
  576. Dim index As Long
  577. 'if the tree is empty, exit
  578. If TreeView1.Nodes.Count = 0 Then Exit Sub
  579. 'if the key matches a device key, set the device array index to the key index
  580. If Left$(TreeView1.SelectedItem.Key, 3) = "Dev" And IsNumeric(Right$(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 3)) Then
  581.     index = Right$(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 3)
  582.     DevInfo.Visible = False
  583.     DrvInfo.Visible = False
  584.     Extra.Visible = False
  585.     Exit Sub
  586. End If
  587. '-----------------------------------------------------------------------
  588. 'fill in device information
  589. Dim temp As Long, stemp As Long
  590. DevInfo.Visible = False 'hide the text box
  591. DevInfo.Text = "" 'reset text
  592. temp = UBound(DeviceInfo(index).DevProps) 'get the size of the array
  593. For x = 0 To temp
  594.     If x <> 4 Then 'skip ExtraInfoID
  595.         'add device information
  596.         DevInfo.Text = DevInfo.Text + DeviceInfo(index).DevProps(x).PropDesc & ": "
  597.         DevInfo.Text = DevInfo.Text + DeviceInfo(index).DevProps(x).PropVal & vbNewLine
  598.     End If
  599. Next x
  600. For x = 0 To temp
  601.     If x <> 4 Then
  602.         'find the PropDesc and make them bold
  603.         stemp = DevInfo.Find(DeviceInfo(index).DevProps(x).PropDesc & ":", stemp, , 2)
  604.         DevInfo.SelBold = True
  605.     End If
  606. Next x
  607. DevInfo.SelStart = 0 'reset selection
  608. DevInfo.SelBold = False 'turn off bold
  609. DevInfo.Visible = True 'show text box
  610. '----------------------------------------------------------------------
  611. 'fill in driver information
  612. temp = 0: stemp = 0 'reset variables
  613. DrvInfo.Visible = False 'hide the text box
  614. DrvInfo.Text = "" 'reset text
  615. temp = UBound(DriverInfo(index).DevProps) 'get the size of the array
  616. For x = 0 To temp
  617.     'add driver information
  618.     DrvInfo.Text = DrvInfo.Text + DriverInfo(index).DevProps(x).PropDesc & ": "
  619.     DrvInfo.Text = DrvInfo.Text + DriverInfo(index).DevProps(x).PropVal & vbNewLine
  620. Next x
  621. For x = 0 To temp
  622.     'find PropDesc and make them bold
  623.     stemp = DrvInfo.Find(DriverInfo(index).DevProps(x).PropDesc & ":", stemp, , 2)
  624.     DrvInfo.SelBold = True
  625. Next x
  626. DrvInfo.SelStart = 0 'reset selection
  627. DrvInfo.SelBold = False 'turn off bold
  628. DrvInfo.Visible = True 'show text box
  629. '-------------------------------------------------------------------------
  630. 'fill in extra info
  631. Dim ExtraInfoID As Long 'create variable to link extrainfoid from device array
  632. ExtraInfoID = DeviceInfo(index).DevProps(4).PropVal 'assign ExtraInfoID
  633. Extra.Visible = False 'hide text box
  634. Extra.Text = "" 'reset the text
  635. temp = 0: stemp = 0 'reset variables
  636. If ExtraInfoID > -1 Then 'check if there is extra info
  637.     temp = UBound(ExtraInfo(ExtraInfoID).DevProps) 'get the size of the array
  638.     For x = 0 To temp
  639.         'add the extra info
  640.         Extra.Text = Extra.Text + ExtraInfo(ExtraInfoID).DevProps(x).PropDesc + ": "
  641.         Extra.Text = Extra.Text + ExtraInfo(ExtraInfoID).DevProps(x).PropVal & vbNewLine
  642.     Next x
  643.     'make titles bold
  644.     For x = 0 To temp
  645.         'find the PropDesc and make them bold
  646.         stemp = Extra.Find(ExtraInfo(ExtraInfoID).DevProps(x).PropDesc + ":", stemp, , 2)
  647.         Extra.SelBold = True
  648.     Next x
  649.     Extra.SelStart = 0 'reset selection
  650.     Extra.SelBold = False 'turn off bold
  651.     Extra.Text = "None"
  652. End If
  653. Extra.Visible = True 'make text box visible
  654. End Sub
  655. Private Sub TreeView1_KeyUp(KeyCode As Integer, Shift As Integer)
  656. TreeView1_Click 'if someone presses a key, update the device info
  657. End Sub
  658. Private Sub txtComputerName_Change()
  659. 'if it's not equal to this computer's name
  660. If UCase$(txtComputerName.Text) <> UCase$(ComputerName) Then
  661.     'set it to unknown
  662.     cmboWinVer.ListIndex = 2
  663.     'if it is this computer's name
  664.     'make the combo say the correct windows version
  665.     If WinVersion = "NT" Then
  666.         cmboWinVer.ListIndex = 0
  667.     Else
  668.         cmboWinVer.ListIndex = 1
  669.     End If
  670. End If
  671. End Sub
  672. Private Sub txtComputerName_GotFocus()
  673. 'whenever it gets focus, highlight the entire contents
  674. With txtComputerName
  675.     .SelStart = 0
  676.     .SelLength = Len(.Text)
  677. End With
  678. End Sub
  679. Private Sub DisplayCompInfo()
  680. lblProductName.Caption = CI.ProductName
  681. lblVersion.Caption = CI.CurrentVersion & "." & CI.CurrentBuildNumber
  682. lblCSDVersion.Caption = CI.CSDVersion
  683. lblProductID.Caption = CI.ProductID
  684. lblROwner.Caption = CI.RegisteredOwner
  685. lblROrganization.Caption = CI.RegisteredOrganization
  686. lblVendorID.Caption = CPU.VendorIdentifier
  687. lblProcessorName.Caption = CPU.ProcessorNameString
  688. lblIdentifier.Caption = CPU.Identifier
  689. lblMHz.Caption = CPU.MHz & "MHz"
  690. lblSysID.Caption = CI.SystemIdentifier
  691. lblBiosVersion.Caption = CI.SystemBiosVersion
  692. lblBiosDate.Caption = CI.SystemBiosDate
  693. lblVidBiosVersion.Caption = CI.VideoBiosVersion
  694. lblVidBiosDate.Caption = CI.VideoBiosDate
  695. Frame4.Refresh
  696. End Sub
  697. Private Sub txtServerName_Change()
  698. If Len(txtServerName.Text) = 0 Then
  699.     btnFindComp.Enabled = False
  700.     btnFindComp.Enabled = True
  701. End If
  702. End Sub
  703.