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

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

?? frmmain.frm

?? 串口通信
?? 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$

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品一区二区| 日韩中文字幕亚洲一区二区va在线| 99久久99久久精品国产片果冻| 久久精品噜噜噜成人88aⅴ | 国产一区二区调教| 免费在线一区观看| 99久久精品一区| 制服丝袜亚洲精品中文字幕| 色呦呦国产精品| 91片黄在线观看| 91福利在线观看| 欧美日韩精品二区第二页| 欧美日韩国产首页| 中文字幕中文字幕中文字幕亚洲无线| 1区2区3区欧美| 一区二区三区四区精品在线视频 | 欧美精品成人一区二区三区四区| 欧美日本国产视频| 亚洲靠逼com| 日韩精品三区四区| 国产精品一二三四区| 91免费观看视频在线| 欧美国产精品v| 国产综合色精品一区二区三区| 99久久免费国产| 国产精品久久毛片a| 国内精品自线一区二区三区视频| 91精品国产综合久久久蜜臀图片 | 97久久人人超碰| 欧美韩国一区二区| 国产成人精品免费看| 色综合色综合色综合色综合色综合| 久久久不卡影院| 亚洲欧美日韩中文字幕一区二区三区 | 日韩三级在线免费观看| 欧美va亚洲va香蕉在线| 欧美经典一区二区三区| 中文字幕日本不卡| 99re视频这里只有精品| 一区二区在线观看免费| 色999日韩国产欧美一区二区| 亚洲欧洲一区二区在线播放| 97精品电影院| 亚洲乱码中文字幕| 欧美性xxxxxxxx| 国产午夜亚洲精品午夜鲁丝片| 亚洲黄色av一区| 欧美亚洲一区二区在线| 午夜精品福利视频网站| 99riav久久精品riav| 亚洲男帅同性gay1069| 色综合咪咪久久| 亚洲v中文字幕| 91一区一区三区| 亚洲电影你懂得| 日韩你懂的在线观看| 亚洲一级二级在线| 91视视频在线观看入口直接观看www | 日本乱人伦一区| 亚洲地区一二三色| 精品国产髙清在线看国产毛片 | 成人免费黄色大片| 精品久久久久久久久久久久久久久久久 | 不卡视频一二三| 日韩一区二区三区高清免费看看| 免费成人在线播放| 亚洲国产成人午夜在线一区| 日本久久一区二区三区| 美美哒免费高清在线观看视频一区二区| www.欧美日韩| 国产欧美日韩在线观看| 色呦呦网站一区| 久久99在线观看| 亚洲免费观看高清完整| 日韩三级在线观看| 白白色 亚洲乱淫| 秋霞成人午夜伦在线观看| 国产精品超碰97尤物18| 91精品蜜臀在线一区尤物| 国产69精品久久99不卡| 欧美激情艳妇裸体舞| 欧美日韩一区在线观看| 亚洲一区在线观看免费| 久久久久久久久久看片| 欧美日韩高清一区| 不卡免费追剧大全电视剧网站| 日韩成人免费电影| 日韩女优av电影在线观看| 日本精品一级二级| 国产精品资源在线| 日本强好片久久久久久aaa| 国产精品久久久久久久久果冻传媒| 91超碰这里只有精品国产| 91一区二区在线| 国产精品1区二区.| 久久精品国产精品亚洲红杏| 亚洲精品欧美专区| 国产精品久久久久永久免费观看 | 久久奇米777| 宅男噜噜噜66一区二区66| 91蝌蚪国产九色| 国产999精品久久久久久| 美腿丝袜亚洲三区| 午夜日韩在线观看| 亚洲观看高清完整版在线观看| 欧美高清视频不卡网| 色噜噜夜夜夜综合网| 99re这里只有精品首页| 成人手机电影网| 丁香天五香天堂综合| 国产精品一区二区三区四区| 久久成人免费网站| 久久精品国产网站| 经典一区二区三区| 亚洲欧美日韩在线播放| 中文字幕乱码一区二区免费| 久久久久久夜精品精品免费| 日韩女优制服丝袜电影| 日韩一区二区三区视频在线| 91精品国产色综合久久不卡蜜臀| 国产乱人伦偷精品视频不卡| 精品一区精品二区高清| 蜜桃av噜噜一区二区三区小说| 免费看日韩精品| 久久丁香综合五月国产三级网站| 免费成人在线观看视频| 国模少妇一区二区三区| 国内精品久久久久影院色 | 久久久亚洲综合| 久久精品在这里| 中文字幕精品—区二区四季| 日韩一区欧美一区| 亚洲尤物在线视频观看| 国产成人一区在线| 成人夜色视频网站在线观看| jizzjizzjizz欧美| 在线观看日韩电影| 丁香婷婷深情五月亚洲| 91亚洲精品久久久蜜桃| 精品视频免费看| 欧美电影精品一区二区| 欧美激情在线看| 一区二区激情小说| 免费视频最近日韩| 国产精品一二三四区| 97久久超碰国产精品| 欧美日韩黄视频| 亚洲精品一区二区三区香蕉| 日本一区二区三区国色天香| 亚洲美女精品一区| 蜜桃久久精品一区二区| 国产精品18久久久久久久久| 91免费版在线| 日韩视频一区在线观看| 国产精品久久二区二区| 天天爽夜夜爽夜夜爽精品视频| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美日韩极品在线观看一区| 日韩美女天天操| 1024成人网| 久久成人av少妇免费| 日本韩国精品一区二区在线观看| 日韩你懂的在线观看| 亚洲欧美激情一区二区| 久久疯狂做爰流白浆xx| 欧美午夜免费电影| 欧美国产精品劲爆| 美女国产一区二区| 欧美色偷偷大香| 国产欧美日韩精品一区| 午夜伦理一区二区| 99精品视频在线观看免费| 精品日韩欧美在线| 亚洲一区二区三区爽爽爽爽爽| 国产成人免费9x9x人网站视频| 欧美三级电影在线观看| 中文字幕在线不卡国产视频| 久久99国产精品免费| 欧美日韩一区中文字幕| 亚洲欧美日韩国产综合| 国产91丝袜在线播放0| 日韩欧美亚洲另类制服综合在线| 亚洲日本青草视频在线怡红院| 亚洲人被黑人高潮完整版| 国产精品99久久久久久久vr | 国产激情视频一区二区在线观看 | 欧美午夜精品一区二区三区| 中文字幕欧美日韩一区| 国产美女在线精品| 日韩精品一区二区三区中文不卡| 亚洲国产精品一区二区久久恐怖片| 成人美女在线观看| 中文字幕乱码亚洲精品一区| 国产乱人伦精品一区二区在线观看| 欧美一区日本一区韩国一区| 亚洲成人久久影院| 欧美日韩美少妇| 性久久久久久久| 3atv在线一区二区三区| 三级精品在线观看|