网站首页  词典首页

请输入您要查询的函数:

 

术语 getrawinputdevicelist
释义 GetRawInputDeviceList
语法:
UINT GetRawInputDeviceList( PRAWINPUTDEVICELIST pRawInputDeviceList,
PUINT puiNumDevices,
UINT cbSize
);
GetRawInputDeviceList功能
该GetRawInputDeviceList函数枚举原始输入连接到系统的设备。
参数
pRawInputDeviceList
[out]指向缓冲区持有的RAWINPUTDEVICELIST结构,附加到系统的设备数组。如果为NULL,设备的数量是返回* puiNumDevices。
puiNumDevices
[中,out]指向一个变量。如果pRawInputDeviceList为NULL,则函数填充了这个连接到系统的设备的数量变量,否则,此变量指定RAWINPUTDEVICELIST可以在缓冲区内的结构号码,pRawInputDeviceList点。如果此值比连接到系统的设备数量少,函数返回这个变量的实际数目的设备和ERROR_INSUFFICIENT_BUFFER失败。
cbSize
[in]一个RAWINPUTDEVICELIST结构的大小。
返回值
如果函数成功,返回值是存储在缓冲区中设备的数量指向pRawInputDeviceList。
在任何其他错误,则函数返回(机组)-1,GetLastError返回错误指示。
备注
从这个函数返回的设备是鼠标,键盘和其他人机接口设备(HID)设备。
要获得更详细的连接的设备信息,请调用GetRawInputDeviceInfo利用从RAWINPUTDEVICELIST hDevice。下面的示例代码显示了一个典型的GetRawInputDeviceList电话:
UINT nDevices;
PRAWINPUTDEVICELIST pRawInputDeviceList;
if (GetRawInputDeviceList(NULL, &nDevices, sizeof(RAWINPUTDEVICELIST)) != 0) { Error();}
if ((pRawInputDeviceList = malloc(sizeof(RAWINPUTDEVICELIST) * nDevices)) == NULL) {Error();}
if (GetRawInputDeviceList(pRawInputDeviceList, &nDevices, sizeof(RAWINPUTDEVICELIST)) == ()-1) {Error();}
// do the job...
// after the job, free the RAWINPUTDEVICELIST
free(pRawInputDeviceList);
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
XP的最低经营systemsWindows
参见
原始输入,GetRawInputDeviceInfo,RAWINPUTDEVICELIST
==英文原文==GetRawInputDeviceList Function
The GetRawInputDeviceList function enumerates the raw input devices attached to the system.
Syntax
UINT GetRawInputDeviceList( PRAWINPUTDEVICELIST pRawInputDeviceList,
PUINT puiNumDevices,
UINT cbSize
);
Parameters
pRawInputDeviceList
[out] Pointer to buffer that holds an array of RAWINPUTDEVICELIST structures for the devices attached to the system. If NULL, the number of devices are returned in *puiNumDevices.
puiNumDevices
[in, out] Pointer to a variable. If pRawInputDeviceList is NULL, the function populates this variable with the number of devices attached to the system; otherwise, this variable specifies the number of RAWINPUTDEVICELIST structures that can be contained in the buffer to which pRawInputDeviceList points. If this value is less than the number of devices attached to the system, the function returns the actual number of devices in this variable and fails with ERROR_INSUFFICIENT_BUFFER.
cbSize
[in] Size of a RAWINPUTDEVICELIST structure.
Return Value
If the function is successful, the return value is the number of devices stored in the buffer pointed to by pRawInputDeviceList.
On any other error, the function returns (UINT) -1 and GetLastError returns the error indication.
Remarks
The devices returned from this function are the mouse, the keyboard, and other Human Interface Device (HID) devices.
To get more detailed information about the attached devices, call GetRawInputDeviceInfo using the hDevice from RAWINPUTDEVICELIST. The following sample code shows a typical call to GetRawInputDeviceList:
UINT nDevices;
PRAWINPUTDEVICELIST pRawInputDeviceList;
if (GetRawInputDeviceList(NULL, &nDevices, sizeof(RAWINPUTDEVICELIST)) != 0) { Error();}
if ((pRawInputDeviceList = malloc(sizeof(RAWINPUTDEVICELIST) * nDevices)) == NULL) {Error();}
if (GetRawInputDeviceList(pRawInputDeviceList, &nDevices, sizeof(RAWINPUTDEVICELIST)) == ()-1) {Error();}
// do the job...
// after the job, free the RAWINPUTDEVICELIST
free(pRawInputDeviceList);
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows XP
See Also
Raw Input , GetRawInputDeviceInfo , RAWINPUTDEVICELIST
==原始网址==http://msdn.microsoft.com/en-us/library/ms645598(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:18:27