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

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

?? frmmain.frm

?? VB編寫的USB源碼
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
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$

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕五月欧美| 亚洲专区一二三| 在线观看亚洲精品视频| 免费看黄色91| 亚洲精品伦理在线| 久久综合色一综合色88| 91黄色免费看| 国产高清无密码一区二区三区| 玉米视频成人免费看| 日韩美一区二区三区| 日本高清成人免费播放| 国产一区二区影院| 午夜精品aaa| 亚洲视频你懂的| 久久综合色综合88| 欧美一区二区三区免费观看视频| 大陆成人av片| 久久99精品久久久久| 一区二区三区不卡视频| 国产日韩欧美激情| 欧美xxxx在线观看| 欧美美女黄视频| 色婷婷亚洲综合| 成人黄色在线视频| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美一区二区在线不卡| 成人美女视频在线观看| 男女性色大片免费观看一区二区 | 日韩高清在线不卡| 一二三四社区欧美黄| 欧美国产精品一区二区三区| 欧美一区二区三区婷婷月色| 91福利在线播放| 99精品久久免费看蜜臀剧情介绍| 国产一区不卡精品| 蜜桃视频一区二区三区| 亚洲国产一区二区三区青草影视| 亚洲欧洲精品天堂一级| 久久久精品黄色| 久久五月婷婷丁香社区| 日韩视频在线永久播放| 欧美日韩一级二级| 在线观看一区二区精品视频| 91丨porny丨最新| www.综合网.com| 北条麻妃一区二区三区| 国产成人一区在线| 韩国女主播一区| 国产综合久久久久影院| 激情文学综合插| 激情综合色播激情啊| 久久国产剧场电影| 久久狠狠亚洲综合| 九九精品一区二区| 精品无码三级在线观看视频| 精品一区二区av| 国产剧情一区二区三区| 国产精品综合在线视频| 懂色av一区二区在线播放| 成人在线综合网| 北条麻妃一区二区三区| 日本韩国欧美三级| 欧美日韩免费观看一区三区| 欧美区视频在线观看| 欧美蜜桃一区二区三区| 欧美一区二区三区不卡| 欧美成人午夜电影| 国产午夜亚洲精品不卡| 中文字幕乱码亚洲精品一区 | 亚洲欧美aⅴ...| 亚洲精品国产精华液| 亚洲一区二区中文在线| 日本伊人精品一区二区三区观看方式| 蜜桃av噜噜一区二区三区小说| 久久成人羞羞网站| 国产成人精品亚洲日本在线桃色| 色综合久久88色综合天天| 欧美亚洲尤物久久| 日韩免费观看高清完整版在线观看| 久久精品人人做| 一区二区三区中文在线观看| 奇米精品一区二区三区四区| 波多野洁衣一区| 日韩一级大片在线| 亚洲国产精品成人综合| 亚洲一区二区三区在线| 久久精品999| 色婷婷综合在线| 精品国产伦一区二区三区免费| 亚洲欧美在线另类| 日韩avvvv在线播放| 国产91精品在线观看| 在线一区二区三区做爰视频网站| 日韩欧美国产综合| 亚洲欧美国产77777| 免费成人深夜小野草| 成人深夜视频在线观看| 欧美日韩大陆在线| 中文字幕不卡在线播放| 亚洲成人自拍网| 粗大黑人巨茎大战欧美成人| 欧美精品一卡二卡| 自拍偷在线精品自拍偷无码专区| 美女看a上一区| 在线视频欧美精品| 国产午夜精品一区二区三区视频| 水野朝阳av一区二区三区| 风流少妇一区二区| 日韩视频一区二区三区| 亚洲天堂福利av| 国产一区二区免费在线| 欧美日韩国产经典色站一区二区三区 | 男男视频亚洲欧美| 91视频.com| 久久久国际精品| 六月丁香婷婷久久| 欧美三电影在线| 自拍av一区二区三区| 国产一区欧美日韩| 日韩视频一区二区三区在线播放 | 天堂精品中文字幕在线| 97精品久久久午夜一区二区三区 | 日韩av成人高清| 在线视频综合导航| 国产精品视频九色porn| 九色综合国产一区二区三区| 正在播放一区二区| 亚洲成人免费在线| 在线看日韩精品电影| 国产精品久久久久久一区二区三区| 精品一区中文字幕| 91精品欧美一区二区三区综合在| 亚洲一区二区三区激情| 91亚洲国产成人精品一区二三 | 成人黄色小视频| 国产丝袜欧美中文另类| 久久精品国产99国产精品| 欧美精品亚洲一区二区在线播放| 一级特黄大欧美久久久| 91小视频免费观看| 亚洲精选视频免费看| 99久久er热在这里只有精品15| 中文字幕二三区不卡| 丁香婷婷深情五月亚洲| 国产欧美一区二区精品忘忧草| 国产精品一区二区在线看| 精品国产髙清在线看国产毛片| 久久国产精品第一页| 日韩欧美国产综合在线一区二区三区| 美国三级日本三级久久99| 欧美一区二区三区免费视频| 久久丁香综合五月国产三级网站| 精品精品国产高清a毛片牛牛| 精品一区二区三区久久| 久久综合九色综合97婷婷女人| 国产精品99久久久久久有的能看 | 91精品国产手机| 五月激情综合色| 91精品国产欧美一区二区18 | 色综合天天综合网天天看片| 一区二区三区中文在线观看| 欧美日韩高清一区二区三区| 日本不卡123| 久久精品亚洲精品国产欧美 | 亚洲久本草在线中文字幕| 欧美性感一区二区三区| 日韩成人av影视| 亚洲精品在线一区二区| 国产精品69毛片高清亚洲| 国产精品国模大尺度视频| 91首页免费视频| 午夜视黄欧洲亚洲| 精品久久久三级丝袜| 国产成人鲁色资源国产91色综| 亚洲欧美日韩在线不卡| 欧美日韩大陆一区二区| 极品少妇xxxx精品少妇| 国产精品超碰97尤物18| 精品视频在线视频| 激情丁香综合五月| 自拍偷拍欧美激情| 日韩一区二区在线看片| 丰满亚洲少妇av| 婷婷丁香激情综合| 中文字幕欧美三区| 欧美老肥妇做.爰bbww| 国产成+人+日韩+欧美+亚洲| 亚洲gay无套男同| 精品国产污污免费网站入口 | 91麻豆精品国产91久久久使用方法| 久久电影国产免费久久电影| 自拍av一区二区三区| 日韩一级免费观看| 91在线观看地址| 黄网站免费久久| 亚洲精品国产a| 国产亚洲欧美日韩日本| 91国偷自产一区二区开放时间| 美女视频网站久久| 一区在线播放视频|