home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _MED-VOL.FRM < prev    next >
Text File  |  1998-05-21  |  7KB  |  269 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMediaID 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Media ID - Volume Label"
  5.    ClientHeight    =   4785
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4785
  13.    ScaleWidth      =   7485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   7485
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   7110
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   6210
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   6570
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   4755
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.TextBox txt_Result 
  65.       BackColor       =   &H00C0C0C0&
  66.       BorderStyle     =   0  'None
  67.       Height          =   4005
  68.       Left            =   105
  69.       Locked          =   -1  'True
  70.       MultiLine       =   -1  'True
  71.       ScrollBars      =   2  'Vertical
  72.       TabIndex        =   0
  73.       Top             =   630
  74.       Width           =   7260
  75.    End
  76. End
  77. Attribute VB_Name = "frmMediaID"
  78. Attribute VB_GlobalNameSpace = False
  79. Attribute VB_Creatable = False
  80. Attribute VB_PredeclaredId = True
  81. Attribute VB_Exposed = False
  82. Option Explicit
  83. Option Base 1
  84.  
  85. Private Const Iteration = 25
  86.  
  87. Dim IsLoaded         As Integer
  88.  
  89. Dim TimerStartOk     As Integer
  90. Dim TimerCloseOk     As Integer
  91.  
  92. Dim TimerHandle      As Integer
  93. Dim TimerValue       As Long
  94.  
  95. Private Sub cmdNP_Click(Index As Integer)
  96.  
  97.    Call sub_NextPrev(cmb_Function, Index)
  98.  
  99. End Sub
  100.  
  101.  
  102. Private Sub cmb_Function_Click()
  103.    
  104.    If (IsLoaded = False) Then Exit Sub
  105.    
  106.    Call cDisableFI(mdiT2W.Picture1)
  107.    
  108.    txt_Result = ""
  109.    
  110.    DoEvents
  111.    
  112.    Select Case cmb_Function.ListIndex
  113.       Case 0
  114.          Call TestMediaID
  115.       Case 1
  116.          Call TestVolume
  117.       Case 2
  118.          Call TestDOSMediaID
  119.    End Select
  120.    
  121.    DoEvents
  122.    Call cEnableFI(mdiT2W.Picture1)
  123.    
  124. End Sub
  125.  
  126.  
  127. Private Sub Form_Activate()
  128.  
  129.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  130.  
  131. End Sub
  132.  
  133. Private Sub Form_Load()
  134.  
  135.    IsLoaded = False
  136.    
  137.    Show
  138.  
  139.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_med-vol.t2w")
  140.    
  141.    IsLoaded = True
  142.    
  143. End Sub
  144.  
  145. Private Sub Command1_Click()
  146.    
  147.    Call cmb_Function_Click
  148.    
  149. End Sub
  150.  
  151. Private Sub TestMediaID()
  152.    
  153.    Dim intResult        As Integer
  154.    Dim strResult        As String
  155.    Dim strDisplay       As String
  156.    
  157.    Dim i                As Integer
  158.    
  159.    Dim MEDIAID          As tagMEDIAID
  160.   
  161.    strResult = ""
  162.    strDisplay = ""
  163.      
  164.    For i = 1 To 4
  165.       intResult = cGetMediaID(Chr$(64 + i), MEDIAID)
  166.       If (intResult = True) Then
  167.          strDisplay = strDisplay & "MEDIA ID found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  168.          strDisplay = strDisplay & "   VolumeName : '" & MEDIAID.VolumeName & "'" & vbCrLf
  169.          strDisplay = strDisplay & "   VolumeSerialNumber : '" & Hex$(MEDIAID.VolumeSerialNumber) & "'" & vbCrLf
  170.          strDisplay = strDisplay & "   SystemName : '" & MEDIAID.SystemName & "'" & vbCrLf
  171.          strDisplay = strDisplay & "   MaxNameLength : '" & MEDIAID.MaxNameLength & "'" & vbCrLf
  172.          strDisplay = strDisplay & "   FileSystemFlags : '" & MEDIAID.FileSystemFlags & "'" & vbCrLf & vbCrLf
  173.       Else
  174.          strDisplay = strDisplay & "MEDIA ID not found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  175.       End If
  176.    Next i
  177.  
  178.    txt_Result = strDisplay
  179.  
  180.    'time the function
  181.  
  182.    TimerHandle = cTimerOpen()
  183.    TimerStartOk = cTimerStart(TimerHandle)
  184.    
  185.    For i = 1 To Iteration
  186.       intResult = cGetMediaID("C", MEDIAID)
  187.    Next i
  188.    
  189.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  190.    
  191.    TimerCloseOk = cTimerClose(TimerHandle)
  192.  
  193. End Sub
  194.  
  195. Private Sub TestDOSMediaID()
  196.    
  197.    Dim intResult        As Integer
  198.    Dim strResult        As String
  199.    Dim strDisplay       As String
  200.    
  201.    Dim i                As Integer
  202.    
  203.    Dim DOSMEDIAID       As tagDOSMEDIAID
  204.   
  205.    strResult = ""
  206.    strDisplay = ""
  207.      
  208.    For i = 1 To 4
  209.       intResult = cDOSGetMediaID(Chr$(64 + i), DOSMEDIAID)
  210.       If (intResult = True) Then
  211.          strDisplay = strDisplay & "DOS MEDIA ID found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  212.          strDisplay = strDisplay & "   InfoLevel : '" & Hex$(cCVI(DOSMEDIAID.InfoLevel)) & "'" & vbCrLf
  213.          strDisplay = strDisplay & "   SerialNumber : '" & Hex$(cCVL(DOSMEDIAID.SerialNumber)) & "'" & vbCrLf
  214.          strDisplay = strDisplay & "   VolLabel : '" & cCompress(DOSMEDIAID.VolLabel) & "'" & vbCrLf
  215.          strDisplay = strDisplay & "   FileSysType : '" & cCompress(DOSMEDIAID.FileSysType) & "'" & vbCrLf & vbCrLf
  216.       Else
  217.          strDisplay = strDisplay & "DOS MEDIA ID not found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  218.       End If
  219.    Next i
  220.  
  221.    txt_Result = strDisplay
  222.  
  223.    'time the function
  224.  
  225.    TimerHandle = cTimerOpen()
  226.    TimerStartOk = cTimerStart(TimerHandle)
  227.    
  228.    For i = 1 To Iteration
  229.       intResult = cDOSGetMediaID("C", DOSMEDIAID)
  230.    Next i
  231.    
  232.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  233.    
  234.    TimerCloseOk = cTimerClose(TimerHandle)
  235.  
  236. End Sub
  237.  
  238. Private Sub TestVolume()
  239.    
  240.    Dim intResult        As Integer
  241.    Dim strResult        As String
  242.    Dim strDisplay       As String
  243.    
  244.    Dim i                As Integer
  245.   
  246.    strResult = ""
  247.    strDisplay = ""
  248.      
  249.    For i = 1 To 4
  250.       strDisplay = strDisplay & "Volume Label for '" & Chr$(64 + i) & "' is '" & cGetVolumeLabel(Chr$(64 + i)) & "'" & vbCrLf & vbCrLf
  251.    Next i
  252.  
  253.    txt_Result = strDisplay
  254.  
  255.    'time the function
  256.  
  257.    TimerHandle = cTimerOpen()
  258.    TimerStartOk = cTimerStart(TimerHandle)
  259.    
  260.    For i = 1 To Iteration
  261.       strResult = cGetVolumeLabel("C")
  262.    Next i
  263.    
  264.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  265.    
  266.    TimerCloseOk = cTimerClose(TimerHandle)
  267.  
  268. End Sub
  269.