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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? frmmain.frm

?? VB編寫(xiě)的USB源碼
?? FRM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "USB Complete"
   ClientHeight    =   4392
   ClientLeft      =   252
   ClientTop       =   336
   ClientWidth     =   6132
   LinkTopic       =   "Form1"
   ScaleHeight     =   4392
   ScaleWidth      =   6132
   Begin VB.Timer tmrContinuousDataCollect 
      Left            =   120
      Top             =   3960
   End
   Begin VB.Frame fraSendAndReceive 
      Caption         =   "Send and Receive Data"
      Height          =   1692
      Left            =   3960
      TabIndex        =   7
      Top             =   120
      Width           =   2052
      Begin VB.CommandButton cmdContinuous 
         Caption         =   "Continuous"
         Height          =   372
         Left            =   360
         TabIndex        =   9
         Top             =   1080
         Width           =   1452
      End
      Begin VB.CommandButton cmdOnce 
         Caption         =   "Once"
         Height          =   372
         Left            =   360
         TabIndex        =   8
         Top             =   360
         Width           =   1452
      End
   End
   Begin VB.Frame fraBytesReceived 
      Caption         =   "Bytes Received"
      Height          =   1692
      Left            =   2400
      TabIndex        =   4
      Top             =   120
      Width           =   1452
      Begin VB.TextBox txtBytesReceived 
         Height          =   732
         Left            =   360
         MultiLine       =   -1  'True
         TabIndex        =   5
         Top             =   600
         Width           =   732
      End
   End
   Begin VB.Frame fraBytesToSend 
      Caption         =   "Bytes to Send"
      Height          =   1692
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   2172
      Begin VB.CheckBox chkAutoincrement 
         Caption         =   "Autoincrement values"
         Height          =   372
         Left            =   240
         TabIndex        =   6
         Top             =   1200
         Width           =   2412
      End
      Begin VB.ComboBox cboByte1 
         Height          =   288
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   840
         Width           =   1212
      End
      Begin VB.ComboBox cboByte0 
         Height          =   288
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   360
         Width           =   1212
      End
   End
   Begin VB.Timer tmrDelay 
      Enabled         =   0   'False
      Left            =   120
      Top             =   11400
   End
   Begin VB.ListBox lstResults 
      Height          =   2352
      Left            =   120
      TabIndex        =   0
      Top             =   1920
      Width           =   5892
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Project: usbhidio.vbp
'Version: 1.1
'Date: 11/20/99
'Copyright 1999 by Jan Axelson (jan@lvr.com)
'
'Purpose: demonstrates USB communications with an HID-class device
'Description:
'Finds an attached device that matches specific vendor and product IDs.
'Retrieves the device's capabilities.
'Sends two bytes to the device using Input reports.
'Receives two bytes from the device in Output reports.
'(For testing, the current device firmware adds 1 to the received bytes
'and sends them back.)
'A list box displays the data sent and received,
'along with error and status messages.
'Combo boxes enable you to select data to send, and to select 1-time or
'continuous transfers.

'The companion device firmware is usbhidio.asm,
'for Cypress Semiconductor's CY7C63001 USB Microcontroller.
'For more information, visit Lakeview Research at http://www.lvr.com .

'Send comments, bug reports, etc. to jan@lvr.com .

'Changes and updates:
'11/20/99. Revised a few of the comments.
'v1.1 added Else statement in InitializeDisplay routine
'so both combo boxes have all of the values.

Dim Capabilities As HIDP_CAPS
Dim DataString As String
Dim DetailData As Long
Dim DetailDataBuffer() As Byte
Dim DeviceAttributes As HIDD_ATTRIBUTES
Dim DevicePathName As String
Dim DeviceInfoSet As Long
Dim ErrorString As String
Dim HidDevice As Long
Dim LastDevice As Boolean
Dim MyDeviceDetected As Boolean
Dim MyDeviceInfoData As SP_DEVINFO_DATA
Dim MyDeviceInterfaceDetailData As SP_DEVICE_INTERFACE_DETAIL_DATA
Dim MyDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA
Dim Needed As Long
Dim OutputReportData(7) As Byte
Dim PreparsedData As Long
Dim Result As Long
Dim Timeout As Boolean

'Set these to match the values in the device's firmware and INF file.
Const MyVendorID = &H925
Const MyProductID = &H1234

Function FindTheHid() As Boolean
'Makes a series of API calls to locate the desired HID-class device.
'Returns True if the device is detected, False if not detected.

Dim Count As Integer
Dim GUIDString As String
Dim HidGuid As GUID
Dim MemberIndex As Long

LastDevice = False
MyDeviceDetected = False

'******************************************************************************
'HidD_GetHidGuid
'Get the GUID for all system HIDs.
'Returns: the GUID in HidGuid.
'The routine doesn't return a value in Result
'but the routine is declared as a function for consistency with the other API calls.
'******************************************************************************

Result = HidD_GetHidGuid(HidGuid)
Call DisplayResultOfAPICall("GetHidGuid")

'Display the GUID.
GUIDString = _
    Hex$(HidGuid.Data1) & "-" & _
    Hex$(HidGuid.Data2) & "-" & _
    Hex$(HidGuid.Data3) & "-"

For Count = 0 To 7
    'Ensure that each of the 8 bytes in the GUID displays two characters.
    If HidGuid.Data4(Count) >= &H10 Then
        GUIDString = GUIDString & Hex$(HidGuid.Data4(Count)) & " "
    Else
        GUIDString = GUIDString & "0" & Hex$(HidGuid.Data4(Count)) & " "
    End If
Next Count

lstResults.AddItem "  GUID for system HIDs: " & GUIDString

'******************************************************************************
'SetupDiGetClassDevs
'Returns: a handle to a device information set for all installed devices.
'Requires: the HidGuid returned in GetHidGuid.
'******************************************************************************

DeviceInfoSet = SetupDiGetClassDevs _
    (HidGuid, _
    vbNullString, _
    0, _
    (DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE))
    
Call DisplayResultOfAPICall("SetupDiClassDevs")
DataString = GetDataString(DeviceInfoSet, 32)

'******************************************************************************
'SetupDiEnumDeviceInterfaces
'On return, MyDeviceInterfaceData contains the handle to a
'SP_DEVICE_INTERFACE_DATA structure for a detected device.
'Requires:
'the DeviceInfoSet returned in SetupDiGetClassDevs.
'the HidGuid returned in GetHidGuid.
'An index to specify a device.
'******************************************************************************

'Begin with 0 and increment until no more devices are detected.
MemberIndex = 0

Do
    'The cbSize element of the MyDeviceInterfaceData structure must be set to
    'the structure's size in bytes. The size is 28 bytes.
    MyDeviceInterfaceData.cbSize = LenB(MyDeviceInterfaceData)
    Result = SetupDiEnumDeviceInterfaces _
        (DeviceInfoSet, _
        0, _
        HidGuid, _
        MemberIndex, _
        MyDeviceInterfaceData)
    
    Call DisplayResultOfAPICall("SetupDiEnumDeviceInterfaces")
    If Result = 0 Then LastDevice = True
    
    'If a device exists, display the information returned.
    If Result <> 0 Then
        lstResults.AddItem "  DeviceInfoSet for device #" & CStr(MemberIndex) & ": "
        lstResults.AddItem "  cbSize = " & CStr(MyDeviceInterfaceData.cbSize)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data1 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data1)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data2 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data2)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data3 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data3)
        lstResults.AddItem _
            "  Flags = " & Hex$(MyDeviceInterfaceData.Flags)
    
        
        '******************************************************************************
        'SetupDiGetDeviceInterfaceDetail
        'Returns: an SP_DEVICE_INTERFACE_DETAIL_DATA structure
        'containing information about a device.
        'To retrieve the information, call this function twice.
        'The first time returns the size of the structure in Needed.
        'The second time returns a pointer to the data in DeviceInfoSet.
        'Requires:
        'A DeviceInfoSet returned by SetupDiGetClassDevs and
        'an SP_DEVICE_INTERFACE_DATA structure returned by SetupDiEnumDeviceInterfaces.
        '*******************************************************************************
        
        MyDeviceInfoData.cbSize = Len(MyDeviceInfoData)
        Result = SetupDiGetDeviceInterfaceDetail _
           (DeviceInfoSet, _
           MyDeviceInterfaceData, _
           0, _
           0, _
           Needed, _
           0)
        
        DetailData = Needed
            
        Call DisplayResultOfAPICall("SetupDiGetDeviceInterfaceDetail")
        lstResults.AddItem "  (OK to say too small)"
        lstResults.AddItem "  Required buffer size for the data: " & Needed
        
        'Store the structure's size.
        MyDeviceInterfaceDetailData.cbSize = _
            Len(MyDeviceInterfaceDetailData)
        
        'Use a byte array to allocate memory for
        'the MyDeviceInterfaceDetailData structure
        ReDim DetailDataBuffer(Needed)
        'Store cbSize in the first four bytes of the array.
        Call RtlMoveMemory _
            (DetailDataBuffer(0), _
            MyDeviceInterfaceDetailData, _
            4)
        
        'Call SetupDiGetDeviceInterfaceDetail again.
        'This time, pass the address of the first element of DetailDataBuffer
        'and the returned required buffer size in DetailData.
        Result = SetupDiGetDeviceInterfaceDetail _
           (DeviceInfoSet, _
           MyDeviceInterfaceData, _
           VarPtr(DetailDataBuffer(0)), _
           DetailData, _
           Needed, _
           0)
        
        Call DisplayResultOfAPICall(" Result of second call: ")
        lstResults.AddItem "  MyDeviceInterfaceDetailData.cbSize: " & _
            CStr(MyDeviceInterfaceDetailData.cbSize)
        
        'Convert the byte array to a string.
        DevicePathName = CStr(DetailDataBuffer())
        'Convert to Unicode.
        DevicePathName = StrConv(DevicePathName, vbUnicode)
        'Strip cbSize (4 bytes) from the beginning.
        DevicePathName = Right$(DevicePathName, Len(DevicePathName) - 4)
        lstResults.AddItem "  Device pathname: "
        lstResults.AddItem "    " & DevicePathName
                
        '******************************************************************************
        'CreateFile
        'Returns: a handle that enables reading and writing to the device.
        'Requires:
        'The DevicePathName returned by SetupDiGetDeviceInterfaceDetail.
        '******************************************************************************
    
        HidDevice = CreateFile _
            (DevicePathName, _
            GENERIC_READ Or GENERIC_WRITE, _
            (FILE_SHARE_READ Or FILE_SHARE_WRITE), _
            0, _
            OPEN_EXISTING, _
            0, _
            0)
            
        Call DisplayResultOfAPICall("CreateFile")
        lstResults.AddItem "  Returned handle: " & Hex$(HidDevice) & "h"
        
        'Now we can find out if it's the device we're looking for.
        
        '******************************************************************************
        'HidD_GetAttributes
        'Requests information from the device.
        'Requires: The handle returned by CreateFile.
        'Returns: an HIDD_ATTRIBUTES structure containing
        'the Vendor ID, Product ID, and Product Version Number.
        'Use this information to determine if the detected device
        'is the one we're looking for.
        '******************************************************************************
        
        'Set the Size property to the number of bytes in the structure.
        DeviceAttributes.Size = LenB(DeviceAttributes)
        Result = HidD_GetAttributes _
            (HidDevice, _
            DeviceAttributes)
            
        Call DisplayResultOfAPICall("HidD_GetAttributes")
        If Result <> 0 Then
            lstResults.AddItem "  HIDD_ATTRIBUTES structure filled without error."
        Else
            lstResults.AddItem "  Error in filling HIDD_ATTRIBUTES structure."
        End If
    
        lstResults.AddItem "  Structure size: " & DeviceAttributes.Size
        lstResults.AddItem "  Vendor ID: " & Hex$(DeviceAttributes.VendorID)
        lstResults.AddItem "  Product ID: " & Hex$(DeviceAttributes.ProductID)
        lstResults.AddItem "  Version Number: " & Hex$(DeviceAttributes.VersionNumber)
        
        'Find out if the device matches the one we're looking for.
        If (DeviceAttributes.VendorID = MyVendorID) And _
            (DeviceAttributes.ProductID = MyProductID) Then
                lstResults.AddItem "  My device detected"
                MyDeviceDetected = True
        Else
                MyDeviceDetected = False
                'If it's not the one we want, close its handle.
                Result = CloseHandle _
                    (HidDevice)
                DisplayResultOfAPICall ("CloseHandle")
        End If
End If
    'Keep looking until we find the device or there are no more left to examine.

    MemberIndex = MemberIndex + 1

Loop Until (LastDevice = True) Or (MyDeviceDetected = True)

If MyDeviceDetected = True Then
    FindTheHid = True
Else
    lstResults.AddItem " Device not found."
End If

End Function

Private Function GetDataString _
    (Address As Long, _
    Bytes As Long) _
As String

'Retrieves a string of length Bytes from memory, beginning at Address.
'Adapted from Dan Appleman's "Win32 API Puzzle Book"

Dim Offset As Integer
Dim Result$

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色哟哟一区二区在线观看 | ...av二区三区久久精品| 91电影在线观看| 韩国精品一区二区| 午夜精品久久久久久不卡8050| 国产婷婷色一区二区三区四区| 91福利资源站| 国产91对白在线观看九色| 日韩高清在线电影| 一区二区三区在线观看动漫| 国产亚洲短视频| 欧美老肥妇做.爰bbww| 97精品久久久久中文字幕| 国产一区二区在线观看免费 | 一区二区三区欧美久久| 中文字幕第一区综合| 精品国产免费一区二区三区四区 | 中文字幕亚洲视频| 久久九九国产精品| 日韩你懂的在线观看| 欧美性大战久久| 91香蕉视频黄| 成人精品在线视频观看| 国产精品一区二区三区四区| 毛片不卡一区二区| 日本不卡一二三区黄网| 亚洲线精品一区二区三区 | 中文字幕一区免费在线观看| 国产视频一区二区在线| 精品久久久久久久久久久久久久久久久| 在线一区二区视频| 91丝袜高跟美女视频| 99久久伊人精品| 成人动漫视频在线| 成人动漫精品一区二区| 成人福利视频在线看| 成人av电影在线网| 成人av在线资源| 91丨九色丨国产丨porny| 99re热视频精品| av综合在线播放| 99精品欧美一区二区三区小说| 丁香六月综合激情| 成人app网站| 99国产麻豆精品| 欧美在线观看一区| 欧美美女直播网站| 91精品国产黑色紧身裤美女| 日韩视频在线观看一区二区| 精品久久久久久久久久久院品网| 精品国产电影一区二区| 久久久精品中文字幕麻豆发布| 久久午夜色播影院免费高清 | 专区另类欧美日韩| 亚洲柠檬福利资源导航| 亚洲国产va精品久久久不卡综合| 亚洲成人免费在线观看| 免费人成在线不卡| 韩国女主播一区| 成人亚洲一区二区一| 色哟哟精品一区| 91精品国产综合久久精品| 精品免费日韩av| 国产欧美一区二区三区在线老狼| 国产精品久久久久影院亚瑟| 一个色综合网站| 三级欧美在线一区| 黄色日韩网站视频| av欧美精品.com| 精品视频1区2区3区| 精品粉嫩超白一线天av| 国产精品久久久久久久久搜平片| 一区二区三区四区在线免费观看| 日韩高清国产一区在线| 国产乱码精品1区2区3区| 91香蕉视频在线| 欧美一区二区三区日韩视频| 国产午夜亚洲精品羞羞网站| 亚洲综合在线视频| 国模套图日韩精品一区二区| a美女胸又www黄视频久久| 777色狠狠一区二区三区| 久久精品视频免费| 亚洲成人av中文| 成人一区二区三区中文字幕| 欧美日本一区二区| 国产精品入口麻豆九色| 日韩精品一级中文字幕精品视频免费观看 | 99久久国产综合精品女不卡| 欧美一区二区三区精品| 自拍偷拍亚洲激情| 精品一区二区在线观看| 91美女蜜桃在线| 欧美videos大乳护士334| 亚洲一区视频在线| 成人在线一区二区三区| 欧美成人精品1314www| 亚洲黄色在线视频| 国产麻豆精品95视频| 欧美日韩电影一区| 亚洲精品国产精品乱码不99| 国产99久久精品| 日韩精品在线看片z| 亚洲午夜激情av| www.亚洲在线| 久久久99精品免费观看| 美国三级日本三级久久99| 欧美日韩视频不卡| 亚洲男同性恋视频| av在线播放不卡| 久久精品亚洲乱码伦伦中文| 蜜臀av性久久久久av蜜臀妖精| 色中色一区二区| 国产精品女同互慰在线看| 日本aⅴ亚洲精品中文乱码| 欧美午夜精品久久久| 1000部国产精品成人观看| 成人免费视频国产在线观看| 久久嫩草精品久久久精品一| 日本aⅴ免费视频一区二区三区| 在线观看日韩毛片| 亚洲九九爱视频| 99re66热这里只有精品3直播| 国产精品日韩成人| 不卡一区中文字幕| 国产精品美女久久福利网站| 国产一区二区影院| 久久午夜电影网| 国产在线精品一区二区不卡了| 欧美成人vps| 国产真实乱对白精彩久久| 日韩精品一区在线| 狠狠色丁香婷婷综合| 欧美本精品男人aⅴ天堂| 久久精品国产99国产精品| 欧美不卡视频一区| 国产又黄又大久久| 国产校园另类小说区| 成人动漫一区二区三区| 日韩理论电影院| 91色.com| 亚洲一区二区三区四区在线免费观看| 色素色在线综合| 亚洲成a人片综合在线| 欧美精品1区2区| 青椒成人免费视频| 久久久久久久综合色一本| 国产.精品.日韩.另类.中文.在线.播放| 国产亲近乱来精品视频| jlzzjlzz国产精品久久| 一区二区三区自拍| 在线不卡的av| 精品一区二区日韩| 国产精品蜜臀av| 欧美影院精品一区| 秋霞电影一区二区| 国产清纯美女被跳蛋高潮一区二区久久w| 丁香五精品蜜臀久久久久99网站| 中文字幕一区二区在线播放| 在线观看一区不卡| 日本成人在线一区| 国产嫩草影院久久久久| 色天天综合色天天久久| 日本不卡一区二区| 国产欧美视频在线观看| 日本精品裸体写真集在线观看| 午夜欧美大尺度福利影院在线看| 欧美成人bangbros| 91免费版在线看| 日本中文在线一区| 中文一区二区在线观看| 欧美日韩一区二区三区在线| 精品一区二区三区在线观看国产| 国产精品日产欧美久久久久| 欧美性猛交xxxx黑人交| 精品一区二区三区影院在线午夜| 国产精品国产三级国产三级人妇| 欧美日韩精品福利| 国产a区久久久| 日韩专区欧美专区| 国产精品蜜臀av| 日韩欧美一级二级三级久久久| 成人av集中营| 久久99热狠狠色一区二区| 亚洲精品免费一二三区| 久久综合九色综合97_久久久| 一本大道久久a久久精二百| 麻豆精品视频在线观看| 亚洲日本乱码在线观看| 精品日韩av一区二区| 色8久久精品久久久久久蜜| 国内精品久久久久影院一蜜桃| 亚洲精品高清在线| 中文字幕精品三区| 日韩亚洲欧美一区| 欧美图片一区二区三区| 成人综合在线视频| 国内精品视频666| 日韩avvvv在线播放| 亚洲一区二区三区四区在线|