VBDumpPort32.frm
上传用户:gztxhy
上传日期:2020-04-03
资源大小:82k
文件大小:3k
- VERSION 5.00
- Begin VB.Form FrmVBDumpPort32
- BackColor = &H80000000&
- BorderStyle = 1 'Fixed Single
- Caption = "VBDumpPort32"
- ClientHeight = 2160
- ClientLeft = 2295
- ClientTop = 2385
- ClientWidth = 2220
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2160
- ScaleWidth = 2220
- Begin VB.TextBox TxtPortByte
- Alignment = 2 'Center
- Height = 288
- Left = 360
- MaxLength = 2
- TabIndex = 3
- Top = 120
- Width = 1455
- End
- Begin VB.CommandButton BtnQuit
- Caption = "&Quit"
- Height = 372
- Left = 360
- TabIndex = 2
- Top = 1440
- Width = 1455
- End
- Begin VB.CommandButton BtnSet
- Caption = "&Set Value"
- Height = 372
- Left = 360
- TabIndex = 1
- Top = 960
- Width = 1455
- End
- Begin VB.CommandButton BtnGet
- Caption = "&Get Value"
- Height = 372
- Left = 348
- TabIndex = 0
- Top = 480
- Width = 1455
- End
- End
- Attribute VB_Name = "FrmVBDumpPort32"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub BtnGet_Click()
- Dim Result As Boolean
- Dim PortVal As Long
-
- Result = GetPortVal(&H378, PortVal, 1)
-
- If (Result = False) Then
- MsgBox "Whoops ! There is a problem with GetPortByte.", vbOKOnly + vbCritical, "VBDumpPort32"
- Unload FrmVBDumpPort32
- Else
- TxtPortByte = Hex$(PortVal And &HFF)
- End If
- End Sub
- Private Sub BtnQuit_Click()
- Unload FrmVBDumpPort32
- End Sub
- Private Sub BtnSet_Click()
- Dim Result As Boolean
-
- Result = SetPortVal(&H378, Val("&H" + TxtPortByte), 1)
-
- If (Result = False) Then
- MsgBox "Whoops ! There is a problem with SetPortByte.", vbOKOnly + vbCritical, "VBDumpPort32"
- Unload FrmVBDumpPort32
- End If
- End Sub
- Private Sub Form_Load()
- If InitializeWinIo = False Then
- MsgBox "Whoops ! There is a problem with InitializeWinIo.", vbOKOnly + vbCritical, "VBDumpPort32"
- Unload FrmVBDumpPort32
- Else
- Call BtnGet_Click
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Call ShutdownWinIo
- End Sub