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

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

?? frmmain.frm

?? 基于sy2100 ez-usb開發(fā)板的程序
?? FRM
?? 第 1 頁 / 共 2 頁
字號(hào):
'the structure's size in bytes. The size is 28 bytes.
    MyDeviceInterfaceData.cbSize = LenB(MyDeviceInterfaceData)
    Result = SetupDiEnumDeviceInterfaces _
        (DeviceInfoSet, _
        0, _
        HidGuid, _
        MemberIndex, _
        MyDeviceInterfaceData)
    If Result = 0 Then LastDevice = True
'If a device exists, get more information, check for our VID/PID
    If Result <> 0 Then
        
        '******************************************************************************
        '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
            
'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)
        DevicePathName = CStr(DetailDataBuffer())   'Convert the byte array to a string.
        DevicePathName = StrConv(DevicePathName, vbUnicode) 'Convert to Unicode.
'Strip cbSize (4 bytes) from the beginning.
        DevicePathName = Right$(DevicePathName, Len(DevicePathName) - 4)
        '******************************************************************************
        '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)
        
'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)
            
'Find out if the device matches the one we're looking for.
        If (DeviceAttributes.VendorID = MyVendorID) And _
            (DeviceAttributes.ProductID = MyProductID) Then
                MyDeviceDetected = True
        Else
                MyDeviceDetected = False
                'If it's not the one we want, close its handle.
                Result = CloseHandle _
                    (HidDevice)
        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
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$
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 cmdDPBUT_Click()    ' update the decimal point display
If dp = 0 Then
    dp = 255
    shDP.FillColor = vbBlack
Else
    dp = 0
    shDP.FillColor = vbRed
End If
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)
'Copy the data at PreparsedData into a byte array.

Result = RtlMoveMemory _
    (ppData(0), _
    PreparsedData, _
    30)

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)

'******************************************************************************
'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)
End Sub
'_____________________________________________________________
Private Sub ReadReport()    'Read data from the device.
Dim NumberOfBytesRead As Long
Dim ReadBuffer() As Byte 'Allocate a buffer for the report.Byte 0 is the report ID.

'******************************************************************************
'ReadFile (a blocking call, hangs if no IN data)
'Returns: the report in ReadBuffer.
'Requires: a device handle returned by CreateFile,
'the Input report length in bytes returned by HidP_GetCaps.
'******************************************************************************
Dim readval As Byte
'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)

tb7SEG = Hex$(ReadBuffer(1))        ' put first byte value into text box (7-seg value)
readval = ReadBuffer(2)             ' get button states
If (readval And 1) Then
    but(0).FillColor = vbGreen
    If hsRate.Value > 1 Then hsRate.Value = hsRate.Value - 1
    Else: but(0).FillColor = vbBlack
End If
If (readval And 2) Then
    but(1).FillColor = vbGreen
    dp = 0
    shDP.FillColor = vbRed
    Else: but(1).FillColor = vbBlack
End If
If (readval And 4) Then
    but(2).FillColor = vbGreen
    dp = 255
    shDP.FillColor = vbBlack
    Else: but(2).FillColor = vbBlack
End If
If (readval And 8) Then
    but(3).FillColor = vbGreen
    If hsRate.Value < 30 Then hsRate.Value = hsRate.Value + 1
Else: but(3).FillColor = vbBlack
End If
End Sub
'_____________________________________________________________
Private Sub Shutdown()
'stop acquiring data
Do While busy = 1       ' don't shut down during a HID request
Loop
tmrRWData.Enabled = False    ' disable timer
'Close the open handle to the device.
Result = CloseHandle(HidDevice)
'Free memory used by SetupDiGetClassDevs
'Nonzero = success
Result = SetupDiDestroyDeviceInfoList(DeviceInfoSet)
Result = HidD_FreePreparsedData(PreparsedData)
End Sub

'_____________________________________________________________
Private Sub tmrRWData_Timer()
Call ReadAndWriteToDevice
End Sub
'_____________________________________________________________
Private Sub WriteReport()   'Send data to the device.
Dim NumberOfBytesWritten As Long
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
'******************************************************************************
SendBuffer(0) = 0                   'The first byte is the Report ID
SendBuffer(1) = 31 - hsRate.Value   ' next 2 bytes are data--rate
SendBuffer(2) = dp                  ' decimal point

NumberOfBytesWritten = 0

Result = WriteFile _
    (HidDevice, _
    SendBuffer(0), _
    CLng(Capabilities.OutputReportByteLength), _
    NumberOfBytesWritten, _
    0)
End Sub

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区四区在线视频| 欧美日韩国产电影| 亚洲第一狼人社区| 精品av久久707| 一本久久a久久免费精品不卡| 美女性感视频久久| 亚洲裸体在线观看| 欧美va亚洲va国产综合| 在线区一区二视频| 国产一区二区三区综合 | 亚洲视频一二区| 欧美不卡视频一区| 日本韩国一区二区| 国产91精品在线观看| 美女视频黄免费的久久| 国产成人精品三级| 蜜桃一区二区三区在线| 亚洲精品第一国产综合野| 久久一夜天堂av一区二区三区 | 欧美日韩高清一区二区三区| 岛国av在线一区| 激情综合网av| 日韩精品一级二级| 亚洲午夜激情av| 一区二区三区四区高清精品免费观看 | av在线这里只有精品| 国模套图日韩精品一区二区| 天使萌一区二区三区免费观看| 中文字幕一区二区三区精华液| 精品福利一区二区三区免费视频| 91精品国产综合久久香蕉的特点| 91麻豆国产福利精品| 成人av高清在线| 国产成人精品午夜视频免费| 欧美人伦禁忌dvd放荡欲情| 欧美自拍丝袜亚洲| 91成人在线精品| aaa国产一区| jlzzjlzz亚洲日本少妇| 国产成人免费视频网站高清观看视频 | 亚洲综合在线电影| 亚洲精品国产成人久久av盗摄| 亚洲免费观看高清完整版在线观看熊| 欧美国产一区在线| 中文乱码免费一区二区| 中文子幕无线码一区tr| 亚洲国产成人自拍| 国产精品你懂的在线| 国产精品天天摸av网| 国产精品久久久久影院色老大 | 日韩一级大片在线| 日韩亚洲欧美综合| 精品区一区二区| 久久久久久久久久久久久夜| 亚洲精品在线一区二区| 国产亚洲精品久| 亚洲欧洲性图库| 一区二区三区四区在线播放 | 日韩欧美一二三| www激情久久| 中文字幕在线观看不卡| 亚洲精品一二三| 日本欧美在线观看| 九九在线精品视频| 成人av免费在线播放| 在线观看视频一区二区欧美日韩| 欧美日韩一区二区三区视频| 日韩欧美国产电影| 久久精品免视看| 亚洲日本丝袜连裤袜办公室| 一区二区三区久久| 日韩电影免费在线观看网站| 久久精品国产在热久久| 国产成人综合自拍| 91激情在线视频| 精品少妇一区二区三区视频免付费 | 综合色天天鬼久久鬼色| 午夜国产不卡在线观看视频| 韩国欧美国产1区| 色网综合在线观看| 日韩无一区二区| 成人免费在线视频| 六月丁香婷婷久久| av不卡免费在线观看| 日韩一区二区免费在线电影| 中文字幕一区二区三区视频| 午夜a成v人精品| 床上的激情91.| 欧美精品丝袜中出| 国产精品毛片高清在线完整版| 亚洲一二三四在线| 国产呦萝稀缺另类资源| 在线精品视频小说1| 欧美三级日本三级少妇99| 日韩欧美国产精品一区| 中文字幕一区在线| 日韩av一区二| 国产v综合v亚洲欧| 日韩欧美国产不卡| 亚洲欧洲另类国产综合| 天堂成人国产精品一区| 成人激情免费电影网址| 在线播放中文一区| 国产欧美日韩视频在线观看| 日产欧产美韩系列久久99| 成人免费视频一区二区| 欧美久久久久中文字幕| 国产欧美精品日韩区二区麻豆天美 | 日韩欧美中文一区| 中文字幕在线观看不卡视频| 男女视频一区二区| 一本久久精品一区二区| 欧美videos中文字幕| 五月婷婷久久丁香| av爱爱亚洲一区| 久久你懂得1024| 日韩中文字幕麻豆| 91色在线porny| 777欧美精品| 午夜精品在线视频一区| 成人avav影音| 欧美成人一区二区三区在线观看| 亚洲精品欧美专区| 国产一区二区三区综合| 欧美福利视频一区| 性做久久久久久| 成人涩涩免费视频| 久久综合色综合88| 婷婷久久综合九色综合伊人色| 9色porny自拍视频一区二区| 欧美www视频| 国内精品久久久久影院薰衣草| 欧美四级电影在线观看| 亚洲婷婷国产精品电影人久久| 国产精品88av| 久久综合久久综合久久| 免费人成精品欧美精品| 日韩一二三区不卡| 天堂午夜影视日韩欧美一区二区| 91亚洲大成网污www| 中文字幕精品综合| 国产一区福利在线| 欧美成人精品福利| 午夜精品久久久久久久蜜桃app| 99久久精品免费看| 国产精品免费视频一区| 狠狠色综合播放一区二区| 欧美一区二区三区色| 亚洲一二三区不卡| 欧美视频一区二区三区四区 | 久久精品久久久精品美女| 4438x成人网最大色成网站| 亚洲国产精品久久一线不卡| 337p亚洲精品色噜噜噜| 视频一区国产视频| 欧美日韩免费一区二区三区视频| 亚洲国产你懂的| 欧美日韩激情在线| 青青草原综合久久大伊人精品优势| 69久久夜色精品国产69蝌蚪网| 丝袜美腿亚洲色图| 日韩欧美高清一区| 国产一二精品视频| 日韩欧美中文字幕精品| 国产大陆精品国产| 亚洲欧美综合网| 91国产丝袜在线播放| 亚洲综合一二三区| 色悠久久久久综合欧美99| 日本视频一区二区| 精品国产91久久久久久久妲己| 国内精品国产三级国产a久久| 久久精品视频一区二区三区| 成人永久aaa| 亚洲视频小说图片| 欧美日本韩国一区| 国模套图日韩精品一区二区| 国产日产欧美一区| 91麻豆精品在线观看| 日韩高清在线电影| 久久你懂得1024| 99国产一区二区三精品乱码| 亚洲综合av网| 欧美不卡视频一区| 久久精品国产成人一区二区三区| 国产精品不卡一区二区三区| 在线精品视频免费播放| 蜜臀av性久久久久蜜臀aⅴ流畅 | 成人欧美一区二区三区视频网页 | 大胆亚洲人体视频| 亚洲日本丝袜连裤袜办公室| 91精品国产综合久久久蜜臀图片| 成人欧美一区二区三区小说| 99精品久久只有精品| 日韩国产精品大片| 欧美精品一区二区三区很污很色的 | 成人激情综合网站| 免费观看一级特黄欧美大片| 国产亚洲精品精华液| 在线影院国内精品|