亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? frmmain.frm

?? VB編寫的USB源碼
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
Dim ThisByte As Byte

For Offset = 0 To Bytes - 1
    Call RtlMoveMemory(ByVal VarPtr(ThisByte), ByVal Address + Offset, 1)
    If (ThisByte And &HF0) = 0 Then
        Result$ = Result$ & "0"
    End If
    Result$ = Result$ & Hex$(ThisByte) & " "
Next Offset

GetDataString = Result$
End Function

Private Function GetErrorString _
    (ByVal LastError As Long) _
As String

'Returns the error message for the last error.
'Adapted from Dan Appleman's "Win32 API Puzzle Book"

Dim Bytes As Long
Dim ErrorString As String
ErrorString = String$(129, 0)
Bytes = FormatMessage _
    (FORMAT_MESSAGE_FROM_SYSTEM, _
    0&, _
    LastError, _
    0, _
    ErrorString$, _
    128, _
    0)
    
'Subtract two characters from the message to strip the CR and LF.
If Bytes > 2 Then
    GetErrorString = Left$(ErrorString, Bytes - 2)
End If

End Function

Private Sub cmdContinuous_Click()
'Enables the user to select 1-time or continuous data transfers.

If cmdContinuous.Caption = "Continuous" Then
    'Change the command button to Cancel Continuous
    cmdContinuous.Caption = "Cancel Continuous"
    'Enable the timer to read and write to the device once/second.
    tmrContinuousDataCollect.Enabled = True
    Call ReadAndWriteToDevice
Else
    'Change the command button to Continuous
    cmdContinuous.Caption = "Continuous"
    'Disable the timer that reads and writes to the device once/second.
    tmrContinuousDataCollect.Enabled = False
End If

End Sub

Private Sub cmdOnce_Click()
Call ReadAndWriteToDevice
End Sub
Private Sub DisplayResultOfAPICall(FunctionName As String)

'Display the results of an API call.

Dim ErrorString As String

lstResults.AddItem ""
ErrorString = GetErrorString(Err.LastDllError)
lstResults.AddItem FunctionName
lstResults.AddItem "  Result = " & ErrorString

'Scroll to the bottom of the list box.
lstResults.ListIndex = lstResults.ListCount - 1

End Sub

Private Sub Form_Load()
frmMain.Show
tmrDelay.Enabled = False
Call Startup
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call Shutdown
End Sub

Private Sub GetDeviceCapabilities()

'******************************************************************************
'HidD_GetPreparsedData
'Returns: a pointer to a buffer containing information about the device's capabilities.
'Requires: A handle returned by CreateFile.
'There's no need to access the buffer directly,
'but HidP_GetCaps and other API functions require a pointer to the buffer.
'******************************************************************************

Dim ppData(29) As Byte
Dim ppDataString As Variant

'Preparsed Data is a pointer to a routine-allocated buffer.
Result = HidD_GetPreparsedData _
    (HidDevice, _
    PreparsedData)
Call DisplayResultOfAPICall("HidD_GetPreparsedData")

'Copy the data at PreparsedData into a byte array.

Result = RtlMoveMemory _
    (ppData(0), _
    PreparsedData, _
    30)
Call DisplayResultOfAPICall("RtlMoveMemory")

ppDataString = ppData()
'Convert the data to Unicode.
ppDataString = StrConv(ppDataString, vbUnicode)

'******************************************************************************
'HidP_GetCaps
'Find out the device's capabilities.
'For standard devices such as joysticks, you can find out the specific
'capabilities of the device.
'For a custom device, the software will probably know what the device is capable of,
'so this call only verifies the information.
'Requires: The pointer to a buffer containing the information.
'The pointer is returned by HidD_GetPreparsedData.
'Returns: a Capabilites structure containing the information.
'******************************************************************************
Result = HidP_GetCaps _
    (PreparsedData, _
    Capabilities)

Call DisplayResultOfAPICall("HidP_GetCaps")
lstResults.AddItem "  Last error: " & ErrorString
lstResults.AddItem "  Usage: " & Hex$(Capabilities.Usage)
lstResults.AddItem "  Usage Page: " & Hex$(Capabilities.UsagePage)
lstResults.AddItem "  Input Report Byte Length: " & Capabilities.InputReportByteLength
lstResults.AddItem "  Output Report Byte Length: " & Capabilities.OutputReportByteLength
lstResults.AddItem "  Feature Report Byte Length: " & Capabilities.FeatureReportByteLength
lstResults.AddItem "  Number of Link Collection Nodes: " & Capabilities.NumberLinkCollectionNodes
lstResults.AddItem "  Number of Input Button Caps: " & Capabilities.NumberInputButtonCaps
lstResults.AddItem "  Number of Input Value Caps: " & Capabilities.NumberInputValueCaps
lstResults.AddItem "  Number of Input Data Indices: " & Capabilities.NumberInputDataIndices
lstResults.AddItem "  Number of Output Button Caps: " & Capabilities.NumberOutputButtonCaps
lstResults.AddItem "  Number of Output Value Caps: " & Capabilities.NumberOutputValueCaps
lstResults.AddItem "  Number of Output Data Indices: " & Capabilities.NumberOutputDataIndices
lstResults.AddItem "  Number of Feature Button Caps: " & Capabilities.NumberFeatureButtonCaps
lstResults.AddItem "  Number of Feature Value Caps: " & Capabilities.NumberFeatureValueCaps
lstResults.AddItem "  Number of Feature Data Indices: " & Capabilities.NumberFeatureDataIndices

'******************************************************************************
'HidP_GetValueCaps
'Returns a buffer containing an array of HidP_ValueCaps structures.
'Each structure defines the capabilities of one value.
'This application doesn't use this data.
'******************************************************************************

'This is a guess. The byte array holds the structures.
Dim ValueCaps(1023) As Byte

Result = HidP_GetValueCaps _
    (HidP_Input, _
    ValueCaps(0), _
    Capabilities.NumberInputValueCaps, _
    PreparsedData)
   
Call DisplayResultOfAPICall("HidP_GetValueCaps")

'lstResults.AddItem "ValueCaps= " & GetDataString((VarPtr(ValueCaps(0))), 180)
'To use this data, copy the byte array into an array of structures.

End Sub

Private Sub InitializeDisplay()
Dim Count As Integer
Dim ByteValue As String
'Create a dropdown list box for each byte to send.
For Count = 0 To 255
    If Len(Hex$(Count)) < 2 Then
        ByteValue = "0" & Hex$(Count)
    Else
        ByteValue = Hex$(Count)
    End If
    frmMain.cboByte0.AddItem ByteValue, Count
Next Count
For Count = 0 To 255
    If Len(Hex$(Count)) < 2 Then
        ByteValue = "0" & Hex$(Count)
    Else
        ByteValue = Hex$(Count)
    End If
    frmMain.cboByte1.AddItem ByteValue, Count
Next Count
'Select a default item for each box
frmMain.cboByte0.ListIndex = 0
frmMain.cboByte1.ListIndex = 128
End Sub

Private Sub ReadAndWriteToDevice()
'Sends two bytes to the device and reads two bytes back.

Dim DeviceDetected As Boolean

'Report Header
lstResults.AddItem "HID Test Report"
lstResults.AddItem Format(Now, "general date")

'Some data to send
'(if not using the combo boxes):
'OutputReportData(0) = &H12
'OutputReportData(1) = &H34
'OutputReportData(2) = &HF0
'OutputReportData(3) = &HF1
'OutputReportData(4) = &HF2
'OutputReportData(5) = &HF3
'OutputReportData(6) = &HF4
'OutputReportData(7) = &HF5

'Get the bytes to send from the combo boxes.
'Increment the values if the autoincrement check box is selected.
If chkAutoincrement.Value = 1 Then
    If cboByte0.ListIndex < 255 Then
        cboByte0.ListIndex = cboByte0.ListIndex + 1
    Else
        cboByte0.ListIndex = 0
    End If
    If cboByte1.ListIndex < 255 Then
        cboByte1.ListIndex = cboByte1.ListIndex + 1
    Else
        cboByte1.ListIndex = 0
    End If
End If

OutputReportData(0) = cboByte0.ListIndex
OutputReportData(1) = cboByte1.ListIndex

'Find the device
DeviceDetected = FindTheHid
If DeviceDetected = True Then
    'Learn the capabilities of the device
    Call GetDeviceCapabilities
    'Write a report to the device
    Call WriteReport
    
    'The firmware adds 1 to each received byte and sends the bytes back
    'to the host.
    'Add a delay to allow the host time to poll for the returned data.
    Timeout = False
    tmrDelay.Interval = 100
    tmrDelay.Enabled = True
    Do
        DoEvents
    Loop Until Timeout = True
    'Read a report from the device.
    Call ReadReport
Else
End If

'Scroll to the bottom of the list box.
lstResults.ListIndex = lstResults.ListCount - 1

End Sub

Private Sub ReadReport()

'Read data from the device.

Dim Count
Dim NumberOfBytesRead As Long
'Allocate a buffer for the report.
'Byte 0 is the report ID.
Dim ReadBuffer() As Byte
Dim UBoundReadBuffer As Integer

'******************************************************************************
'ReadFile
'Returns: the report in ReadBuffer.
'Requires: a device handle returned by CreateFile,
'the Input report length in bytes returned by HidP_GetCaps.
'******************************************************************************

'ReadFile is a blocking call. The application will hang until the device
'sends the requested amount of data. To prevent hanging, be sure that
'the device always has data to send.

Dim ByteValue As String
'The ReadBuffer array begins at 0, so subtract 1 from the number of bytes.
ReDim ReadBuffer(Capabilities.InputReportByteLength - 1)
    
'Pass the address of the first byte of the read buffer.
Result = ReadFile _
    (HidDevice, _
    ReadBuffer(0), _
    CLng(Capabilities.InputReportByteLength), _
    NumberOfBytesRead, _
    0)
Call DisplayResultOfAPICall("ReadFile")

lstResults.AddItem " Report ID: " & ReadBuffer(0)
lstResults.AddItem " Report Data:"

txtBytesReceived.Text = ""
For Count = 1 To UBound(ReadBuffer)
    'Add a leading 0 to values 0 - Fh.
    If Len(Hex$(ReadBuffer(Count))) < 2 Then
        ByteValue = "0" & Hex$(ReadBuffer(Count))
    Else
        ByteValue = Hex$(ReadBuffer(Count))
    End If
    lstResults.AddItem " " & ByteValue
    'Display the received bytes in the text box.
    txtBytesReceived.SelStart = Len(txtBytesReceived.Text)
    txtBytesReceived.SelText = ByteValue & vbCrLf
    
Next Count
End Sub

Private Sub Shutdown()
'Includes actions that must execute when the program ends.

'Close the open handle to the device.
Result = CloseHandle _
    (HidDevice)
Call DisplayResultOfAPICall("CloseHandle (HidDevice)")

'Free memory used by SetupDiGetClassDevs
'Nonzero = success
Result = SetupDiDestroyDeviceInfoList _
    (DeviceInfoSet)
Call DisplayResultOfAPICall("DestroyDeviceInfoList")

Result = HidD_FreePreparsedData _
    (PreparsedData)
Call DisplayResultOfAPICall("HidD_FreePreparsedData")

End Sub

Private Sub Startup()
Call InitializeDisplay
tmrContinuousDataCollect.Enabled = False
tmrContinuousDataCollect.Interval = 1000
End Sub

Private Sub tmrContinuousDataCollect_Timer()
Call ReadAndWriteToDevice

End Sub

Private Sub tmrDelay_Timer()
Timeout = True
tmrDelay.Enabled = False
End Sub

Private Sub WriteReport()
'Send data to the device.

Dim Count As Integer
Dim NumberOfBytesRead As Long
Dim NumberOfBytesToSend As Long
Dim NumberOfBytesWritten As Long
Dim ReadBuffer() As Byte
Dim SendBuffer() As Byte

'The SendBuffer array begins at 0, so subtract 1 from the number of bytes.
ReDim SendBuffer(Capabilities.OutputReportByteLength - 1)

'******************************************************************************
'WriteFile
'Sends a report to the device.
'Returns: success or failure.
'Requires: the handle returned by CreateFile and
'The output report byte length returned by HidP_GetCaps
'******************************************************************************

'The first byte is the Report ID
SendBuffer(0) = 0

'The next bytes are data
For Count = 1 To Capabilities.OutputReportByteLength - 1
    SendBuffer(Count) = OutputReportData(Count - 1)
Next Count

NumberOfBytesWritten = 0

Result = WriteFile _
    (HidDevice, _
    SendBuffer(0), _
    CLng(Capabilities.OutputReportByteLength), _
    NumberOfBytesWritten, _
    0)
Call DisplayResultOfAPICall("WriteFile")

lstResults.AddItem " OutputReportByteLength = " & Capabilities.OutputReportByteLength
lstResults.AddItem " NumberOfBytesWritten = " & NumberOfBytesWritten
lstResults.AddItem " Report ID: " & SendBuffer(0)
lstResults.AddItem " Report Data:"

For Count = 1 To UBound(SendBuffer)
    lstResults.AddItem " " & Hex$(SendBuffer(Count))
Next Count

End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲香蕉伊在人在线观| 精品一区二区三区久久| 精品一区二区免费视频| 一本大道久久a久久综合婷婷| 欧美一二三四区在线| 亚洲欧美日韩一区二区| 国产激情精品久久久第一区二区 | 欧美主播一区二区三区| 久久久亚洲午夜电影| 亚洲国产精品久久人人爱| 不卡一区中文字幕| 久久久www成人免费无遮挡大片| 亚洲电影一区二区三区| 99热这里都是精品| 中文字幕欧美三区| 国产麻豆精品久久一二三| 日韩免费视频线观看| 偷拍一区二区三区| 欧美三级韩国三级日本一级| 亚洲女同一区二区| 色婷婷综合久久| 最新国产成人在线观看| 国产精品白丝av| 久久综合视频网| 亚洲欧洲另类国产综合| 懂色一区二区三区免费观看| 国产亚洲精品超碰| 国产成人av电影在线| 日本一区二区久久| 成人爱爱电影网址| 日韩理论在线观看| 91网站最新地址| 亚洲人成网站在线| 色吧成人激情小说| 亚洲一区二区影院| 欧美日韩一区二区三区四区五区| 亚洲综合图片区| 欧美日韩久久久久久| 肉色丝袜一区二区| 欧美不卡激情三级在线观看| 老司机免费视频一区二区| 欧美一区二区三区系列电影| 麻豆精品久久久| 国产丝袜欧美中文另类| av中文字幕亚洲| 成人欧美一区二区三区1314| 色婷婷综合久久久| 日韩成人av影视| 精品成人一区二区三区| 成人app网站| 亚洲国产精品久久人人爱蜜臀| 欧美一区二区三区男人的天堂| 黄色精品一二区| 国产精品美女久久久久久久久| 一本久道中文字幕精品亚洲嫩| 亚洲午夜在线视频| 欧美成人aa大片| 91亚洲男人天堂| 日本伊人精品一区二区三区观看方式 | 欧美亚洲综合久久| 久久精品国产99久久6| 国产精品你懂的在线| 欧美三级三级三级| 国产在线看一区| 亚洲一区二区三区免费视频| 精品捆绑美女sm三区| 91一区二区在线| 日韩成人午夜电影| 成人免费一区二区三区视频 | 在线视频中文字幕一区二区| 奇米影视一区二区三区小说| 国产精品日韩成人| 91精选在线观看| 成人av在线影院| 日本欧洲一区二区| 亚洲视频在线观看三级| 日韩欧美黄色影院| 91黄色免费看| 成人免费视频视频| 日韩成人精品在线观看| 亚洲乱码中文字幕| 国产女同性恋一区二区| 欧美一区二区三区不卡| 91免费视频大全| 国产乱妇无码大片在线观看| 午夜a成v人精品| 亚洲三级在线播放| 久久久国际精品| 日韩三级视频在线看| 在线观看www91| av成人老司机| 丁香一区二区三区| 美日韩一区二区| 亚洲一级二级在线| 亚洲欧美日韩国产中文在线| 久久久久久一级片| 欧美va亚洲va在线观看蝴蝶网| 欧亚一区二区三区| 99久久国产综合精品女不卡| 国产精品1024| 韩国中文字幕2020精品| 日本欧美肥老太交大片| 日韩国产成人精品| 无码av免费一区二区三区试看| 亚洲免费三区一区二区| 亚洲视频网在线直播| 中文字幕免费不卡在线| 中文在线资源观看网站视频免费不卡 | 欧美疯狂性受xxxxx喷水图片| 91香蕉视频污| 色综合一区二区三区| 成人激情校园春色| 99精品在线免费| 91年精品国产| 欧美色图一区二区三区| 欧美在线观看你懂的| 欧美影视一区在线| 欧美日韩国产天堂| 91超碰这里只有精品国产| 欧美精品 国产精品| 67194成人在线观看| 日韩天堂在线观看| 精品国免费一区二区三区| 久久毛片高清国产| 国产丝袜欧美中文另类| 亚洲婷婷综合久久一本伊一区| 亚洲欧美日韩国产成人精品影院| 艳妇臀荡乳欲伦亚洲一区| 视频一区二区国产| 精品一区二区在线播放| 成人晚上爱看视频| 欧美主播一区二区三区美女| 8x福利精品第一导航| 久久婷婷国产综合精品青草| 欧美国产精品专区| 一区二区三区高清在线| 视频一区视频二区中文| 国产一区二区免费在线| 99久久精品国产观看| 8x8x8国产精品| 国产丝袜欧美中文另类| 亚洲综合在线电影| 捆绑调教美女网站视频一区| 粉嫩一区二区三区性色av| 欧洲av一区二区嗯嗯嗯啊| 精品久久久影院| 亚洲日本青草视频在线怡红院| 日日夜夜精品视频免费| 国产精品99久久久久久久vr| 色哟哟国产精品| 精品粉嫩aⅴ一区二区三区四区| 亚洲欧美日韩人成在线播放| 蜜桃久久久久久久| 91论坛在线播放| 精品va天堂亚洲国产| 一区二区三区在线观看网站| 久久国产精品区| 在线观看国产91| 欧美精彩视频一区二区三区| 午夜不卡av免费| 91老司机福利 在线| 久久婷婷综合激情| 亚洲成av人片一区二区梦乃| 国产成人精品aa毛片| 91精品国产91久久久久久一区二区| 国产日产精品一区| 免费成人av资源网| 在线一区二区三区做爰视频网站| 久久综合色8888| 日本一区中文字幕| 欧美午夜片在线看| 中文字幕一区二区三区视频| 精品午夜久久福利影院 | 免费成人在线观看视频| 一本大道久久a久久精二百| 久久影院视频免费| 奇米777欧美一区二区| 欧美图片一区二区三区| 国产精品高潮呻吟| 国产ts人妖一区二区| 欧美不卡视频一区| 青青草91视频| 欧美日产国产精品| 亚洲午夜国产一区99re久久| 色天天综合色天天久久| 国产精品久久久久久久岛一牛影视| 久久成人av少妇免费| 91精品国产福利在线观看 | 亚洲激情成人在线| 99re这里都是精品| 最新国产成人在线观看| 白白色亚洲国产精品| 国产精品久久久久久久蜜臀| 高清不卡在线观看| 国产色综合一区| 风间由美性色一区二区三区| 国产色一区二区| caoporm超碰国产精品| 国产精品欧美一区喷水| 成人h动漫精品一区二|