📄 dinput.h
字号:
/*** IDirectInputW methods ***/ STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;};typedef struct IDirectInputW *LPDIRECTINPUTW;#undef INTERFACE#define INTERFACE IDirectInputADECLARE_INTERFACE_(IDirectInputA, IUnknown){ /*** IUnknown methods ***/ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IDirectInputA methods ***/ STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;};typedef struct IDirectInputA *LPDIRECTINPUTA;#ifdef UNICODE#define IID_IDirectInput IID_IDirectInputW#define IDirectInput IDirectInputW#define IDirectInputVtbl IDirectInputWVtbl#else#define IID_IDirectInput IID_IDirectInputA#define IDirectInput IDirectInputA#define IDirectInputVtbl IDirectInputAVtbl#endiftypedef struct IDirectInput *LPDIRECTINPUT;#if !defined(__cplusplus) || defined(CINTERFACE)#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p)#define IDirectInput_Release(p) (p)->lpVtbl->Release(p)#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)#endifextern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);#ifdef UNICODE#define DirectInputCreate DirectInputCreateW#else#define DirectInputCreate DirectInputCreateA#endif // !UNICODE/**************************************************************************** * * Return Codes * ****************************************************************************//* * The operation completed successfully. */#define DI_OK S_OK/* * The device exists but is not currently attached. */#define DI_NOTATTACHED S_FALSE/* * The device buffer overflowed; some input was lost. */#define DI_BUFFEROVERFLOW S_FALSE/* * The change in device properties had no effect. */#define DI_PROPNOEFFECT S_FALSE/* * The device is a polled device. As a result, device buffering * will not collect any data and event notifications will not be * signalled until GetDeviceState is called. */#define DI_POLLEDDEVICE ((HRESULT)0x00000002L)/* * The application requires a newer version of DirectInput. */#define DIERR_OLDDIRECTINPUTVERSION \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)/* * The application was written for an unsupported prerelease version * of DirectInput. */#define DIERR_BETADIRECTINPUTVERSION \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)/* * The object could not be created due to an incompatible driver version * or mismatched or incomplete driver components. */#define DIERR_BADDRIVERVER \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)/* * The device or device instance is not registered with DirectInput. */#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG/* * The requested object does not exist. */#define DIERR_OBJECTNOTFOUND \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)/* * An invalid parameter was passed to the returning function, * or the object was not in a state that admitted the function * to be called. */#define DIERR_INVALIDPARAM E_INVALIDARG/* * The specified interface is not supported by the object */#define DIERR_NOINTERFACE E_NOINTERFACE/* * An undetermined error occured inside the DInput subsystem */#define DIERR_GENERIC E_FAIL/* * The DInput subsystem couldn't allocate sufficient memory to complete the * caller's request. */#define DIERR_OUTOFMEMORY E_OUTOFMEMORY/* * The function called is not supported at this time */#define DIERR_UNSUPPORTED E_NOTIMPL/* * This object has not been initialized */#define DIERR_NOTINITIALIZED \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)/* * This object is already initialized */#define DIERR_ALREADYINITIALIZED \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)/* * This object does not support aggregation */#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION/* * Another app has a higher priority level, preventing this call from * succeeding. */#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED/* * Access to the input device has been lost. It must be re-acquired. */#define DIERR_INPUTLOST \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)/* * The operation cannot be performed while the device is acquired. */#define DIERR_ACQUIRED \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)/* * The operation cannot be performed unless the device is acquired. */#define DIERR_NOTACQUIRED \ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)/* * The specified property cannot be changed. */#define DIERR_READONLY E_ACCESSDENIED/* * The device already has an event notification associated with it. */#define DIERR_HANDLEEXISTS E_ACCESSDENIED/* * Data is not yet available. */#ifndef E_PENDING#define E_PENDING 0x80070007L#endif#ifdef __cplusplus};#endif#endif /* __DINPUT_INCLUDED__ *//**************************************************************************** * * Definitions for non-IDirectInput (VJoyD) features defined more recently * than the current sdk files * ****************************************************************************/#ifdef _INC_MMSYSTEM#ifndef MMNOJOY#ifndef __VJOYDX_INCLUDED__#define __VJOYDX_INCLUDED__#ifdef __cplusplusextern "C" {#endif/* * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure * contains mini-driver specific data to be passed by VJoyD to the mini- * driver instead of doing a poll. */#define JOY_PASSDRIVERDATA 0x10000000l/* * Informs the joystick driver that the configuration has been changed * and should be reloaded from the registery. * dwFlags is reserved and should be set to zero */WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags );/* * Hardware Setting indicating that the device is a headtracker */#define JOY_HWS_ISHEADTRACKER 0x02000000l/* * Hardware Setting indicating that the VxD is used to replace * the standard analog polling */#define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l#ifdef __cplusplus};#endif#endif /* __VJOYDX_INCLUDED__ */#endif /* not MMNOJOY */#endif /* _INC_MMSYSTEM *//**************************************************************************** * * Definitions for non-IDirectInput (VJoyD) features defined more recently * than the current ddk files * ****************************************************************************/#ifdef _INC_MMDDK#ifndef MMNOJOYDEV#ifndef __VJOYDXD_INCLUDED__#define __VJOYDXD_INCLUDED__/* * Poll type in which the do_other field of the JOYOEMPOLLDATA * structure contains mini-driver specific data passed from an app. */#define JOY_OEMPOLL_PASSDRIVERDATA 7#endif /* __VJOYDXD_INCLUDED__ */#endif /* not MMNOJOYDEV */#endif /* _INC_MMDDK */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -