⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hddform.frm

📁 支持PC机的各种端口的读写,包括,并口,串口,USB,等等
💻 FRM
字号:
VERSION 5.00
Begin VB.Form HddForm 
   Caption         =   "HDD IDE Info TVicHW32.DLL 4.0 test example"
   ClientHeight    =   2940
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9855
   LinkTopic       =   "Form1"
   ScaleHeight     =   2940
   ScaleWidth      =   9855
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Dentry 
      Caption         =   "Driver Entry Point"
      Height          =   1035
      Left            =   4920
      TabIndex        =   20
      Top             =   1680
      Width           =   2295
      Begin VB.OptionButton TVicDevice1 
         Caption         =   "TVicDevice1"
         Height          =   255
         Left            =   240
         TabIndex        =   22
         Top             =   660
         Width           =   1575
      End
      Begin VB.OptionButton TVicDevice0 
         Caption         =   "TVicDevice0"
         Height          =   255
         Left            =   240
         TabIndex        =   21
         Top             =   300
         Value           =   -1  'True
         Width           =   1575
      End
   End
   Begin VB.CommandButton B_ReadHddInfo 
      Caption         =   "Read HDD  Information"
      Height          =   495
      Left            =   2340
      TabIndex        =   13
      Top             =   2220
      Width           =   2355
   End
   Begin VB.Frame Frame2 
      Caption         =   " Choose Disk "
      Height          =   2655
      Left            =   180
      TabIndex        =   8
      Top             =   120
      Width           =   1935
      Begin VB.OptionButton C_Slave2 
         Caption         =   "IDE 2 Slave Disk"
         Height          =   255
         Left            =   180
         TabIndex        =   12
         Top             =   2160
         Width           =   1600
      End
      Begin VB.OptionButton C_Master2 
         Caption         =   "IDE 2 Master Disk"
         Height          =   255
         Left            =   180
         TabIndex        =   11
         Top             =   1580
         Width           =   1600
      End
      Begin VB.OptionButton C_Slave1 
         Caption         =   "IDE 1 Slaver Disk"
         Height          =   255
         Left            =   180
         TabIndex        =   10
         Top             =   1000
         Width           =   1600
      End
      Begin VB.OptionButton C_Master1 
         Caption         =   "IDE 1 Master Disk"
         Height          =   255
         Left            =   180
         TabIndex        =   9
         Top             =   420
         Width           =   1600
      End
   End
   Begin VB.CommandButton Open_Driver 
      Caption         =   "Open TVicHW32"
      Height          =   495
      Left            =   7380
      TabIndex        =   7
      Top             =   1680
      Width           =   1155
   End
   Begin VB.CommandButton Close_Driver 
      Caption         =   "Close TVicHW32"
      Height          =   495
      Left            =   8640
      TabIndex        =   6
      Top             =   1680
      Width           =   1155
   End
   Begin VB.Frame Frame1 
      Height          =   1455
      Left            =   7380
      TabIndex        =   1
      Top             =   60
      Width           =   2415
      Begin VB.Label Label3 
         Alignment       =   2  'Center
         Caption         =   "TVicHW32"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   240
         TabIndex        =   5
         Top             =   240
         Width           =   1935
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         Caption         =   "Shareware v.m. 4.0"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   4
         Top             =   600
         Width           =   1935
      End
      Begin VB.Label Label5 
         Alignment       =   2  'Center
         Caption         =   "Copyright (c) Victor Ishikeev"
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   840
         Width           =   2175
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         Caption         =   "mailto: ivi@ufanet.ru"
         Height          =   255
         Left            =   120
         TabIndex        =   2
         Top             =   1080
         Width           =   2175
      End
   End
   Begin VB.CommandButton B_Exit 
      Caption         =   "Exit"
      Height          =   495
      Left            =   7380
      TabIndex        =   0
      Top             =   2340
      Width           =   2415
   End
   Begin VB.Label L_Revision 
      Caption         =   "- - - - - - - - - - - - - - - - - - - - - -"
      Height          =   255
      Left            =   4440
      TabIndex        =   19
      Top             =   1320
      Width           =   2895
   End
   Begin VB.Label L_Serial 
      Caption         =   "- - - - - - - - - - - - - - - - - - - - - -"
      Height          =   255
      Left            =   4440
      TabIndex        =   18
      Top             =   780
      Width           =   2895
   End
   Begin VB.Label L_Model 
      Caption         =   "- - - - - - - - - - - - - - - - - - - - - -"
      Height          =   255
      Left            =   4440
      TabIndex        =   17
      Top             =   240
      Width           =   2895
   End
   Begin VB.Label Label7 
      Caption         =   "Controller Revision Number:"
      Height          =   255
      Left            =   2280
      TabIndex        =   16
      Top             =   1320
      Width           =   1995
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "HDD Serial Number:"
      Height          =   255
      Left            =   2280
      TabIndex        =   15
      Top             =   780
      Width           =   1995
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "HDD Model Number:"
      Height          =   255
      Left            =   2280
      TabIndex        =   14
      Top             =   240
      Width           =   1995
   End
End
Attribute VB_Name = "HddForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim HW32 As Long
Dim ActiveHW As Boolean

Private Sub B_Exit_Click()
 If ActiveHW Then HW32 = CloseTVicHW32(HW32)
  ActiveHW = False
  Unload HddForm
End Sub

Private Sub B_ReadHddInfo_Click()

Dim HddInfo As TypeHddInfo, Master As Integer, IdeNumber As Integer

If C_Master1.Value Then
  Master = 1
  IdeNumber = 1
End If

If C_Master2.Value Then
  Master = 1
  IdeNumber = 2
End If

If C_Slave1.Value Then
  Master = 0
  IdeNumber = 1
End If

If C_Slave2.Value Then
  Master = 0
  IdeNumber = 2
End If

Call GetHDDInfo(HW32, IdeNumber, Master, HddInfo)

L_Serial = HddInfo.SerialNumber
L_Model = HddInfo.Model
L_Revision = HddInfo.Revision
                             
End Sub

Private Sub Close_Driver_Click()
HW32 = CloseTVicHW32(HW32)
  Open_Driver.Enabled = True
  Close_Driver.Enabled = False
  ActiveHW = False
  B_ReadHddInfo.Enabled = False
End Sub

Private Sub Form_Load()
  HW32 = 0
  ActiveHW = False
  C_Master1.Value = True
  Open_Driver.Enabled = True
  Close_Driver.Enabled = False
  B_ReadHddInfo.Enabled = False
End Sub



Private Sub Form_Unload(Cancel As Integer)
  Close_Driver_Click
End Sub

Private Sub Open_Driver_Click()
  HW32 = 0
  If TVicDevice0 Then
    HW32 = OpenTVicHW32(HW32, "TVICHW32", "TVicDevice0")
  Else
    HW32 = OpenTVicHW32(HW32, "TVICHW32", "TVicDevice1")
  End If
  If GetActiveHW(HW32) Then
    Open_Driver.Enabled = False
    Close_Driver.Enabled = True
    B_ReadHddInfo.Enabled = True
    ActiveHW = True
  Else
    ActiveHW = False
    Call MsgBox("Cant Open the driver!", 0, "Warning!")
  End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -