iDirectInputJoyConfig8::EnumTypes 方法 (dinputd.h)

IDirectInputJoyConfig8::EnumTypes 方法枚举 DirectInput 当前支持的游戏杆类型。 游戏杆类型描述 DirectInput 应如何与游戏杆设备通信。 它包括诸如每个轴的状态和位置以及设备支持的按钮数等信息。

语法

HRESULT EnumTypes(
  LPDIJOYTYPECALLBACK unnamedParam1,
  LPVOID              unnamedParam2
);

参数

unnamedParam1

指向接收 DirectInput 游戏杆类型的应用程序定义的回调函数。 有关函数原型,请参阅“备注”部分。

unnamedParam2

指定要传递给回调函数的 32 位应用程序定义值。 此值可以是任何 32 位值;为方便起见,它已原型化为 LPVOID。

返回值

如果成功,则返回DI_OK;否则, 返回以下 COM 错误值之一:

返回代码 说明
DIERR_INVALIDPARAM
一个或多个参数无效。

注解

由于调用 IDirectInputJoyConfig8::EnumTypes 方法,此回调接收 DirectInput 游戏杆类型。



/*
Parameters
pwszTypeName 
Points to the name of the joystick type. A buffer of MAX_JOYSTRING characters is sufficient to hold the type name. The type name should never be shown to the end user; instead, the "display name" should be shown. Use IDirectInputJoyConfig8::GetTypeInfo to obtain the display name of a joystick type. Type names that begin with a pound sign ("#") represent predefined types that cannot be modified or deleted. 

pvRef 
Points to the application-defined value given in the IDirectInputJoyConfig8::EnumTypes method.

Return value
Returns a BOOL value, DIENUM_CONTINUE, to continue the enumeration, or DIENUM_STOP to stop the enumeration. 

*/


BOOL DIEnumJoyTypeProc(
   LPCWSTR pwszTypeName,
   LPVOID  pvRef
);
 



要求

要求
目标平台 桌面
标头 dinputd.h (包括 Dinputd.h)