IDirectInputDevice8

 

 

' ****************************************************************************************
' IDirectInputDevice8 interface
' ****************************************************************************************

' ****************************************************************************************
' Applications use the methods of the IDirectInputDevice8 interface to gain and release
' access to Microsoft DirectInput devices, manage device properties and information, set
' behavior, perform initialization, create and play force-feedback effects, and invoke a
' device's control panel.
' The IDirectInputDevice8 interface is obtained by using the IDirectInput8::CreateDevice
' method. For an example, see Creating a DirectInput Device.
' IDirectInputDevice8 supersedes the IDirectInputDevice, IDirectInputDevice2, and
' IDirectInputDevice7 interfaces used in previous versions of Microsoft DirectX, but does
' not inherit from them. Methods that share names with those from older interfaces perform
' similar services, but may not have exactly the same functionality or behavior. You
' cannot obtain the earlier interfaces by using QueryInterface.
' ****************************************************************************************

'DECLARE_INTERFACE_(IDirectInputDevice8A, IUnknown)
'{
'    /*** IUnknown methods ***/
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)(THIS) PURE;

'    /*** IDirectInputDevice8A methods ***/
'  3.  STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
'  4.  STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
'  5.  STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
'  6.  STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
'  7.  STDMETHOD(Acquire)(THIS) PURE;
'  8.  STDMETHOD(Unacquire)(THIS) PURE;
'  9.  STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
' 10.  STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
' 11.  STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
' 12.  STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
' 13.  STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
' 14.  STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
' 15.  STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
' 16.  STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
' 17.  STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
' 18.  STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
' 19.  STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
' 20.  STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
' 21.  STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
' 22.  STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
' 23.  STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
' 24.  STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
' 25.  STDMETHOD(Poll)(THIS) PURE;
' 26.  STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
' 27.  STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
' 28.  STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
' 29.  STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE;
' 30.  STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE;
' 31.  STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA) PURE;
'};

'DECLARE_INTERFACE_(IDirectInputDevice8W, IUnknown)
'{
'    /*** IUnknown methods ***/
'    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
'    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
'    STDMETHOD_(ULONG,Release)(THIS) PURE;

'    /*** IDirectInputDevice8W methods ***/
'    STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
'    STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
'    STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
'    STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
'    STDMETHOD(Acquire)(THIS) PURE;
'    STDMETHOD(Unacquire)(THIS) PURE;
'    STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
'    STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
'    STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
'    STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
'    STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
'    STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
'    STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
'    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
'    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
'    STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
'    STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
'    STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
'    STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
'    STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
'    STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
'    STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
'    STDMETHOD(Poll)(THIS) PURE;
'    STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
'    STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
'    STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
'    STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
'    STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
'    STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW) PURE;
'};

' ****************************************************************************************
' GetCapabilities method
' Obtains the capabilities of the DirectInputDevice object.
' HRESULT GetCapabilities(
'    LPDIDEVCAPS lpDIDevCaps
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetCapabilities ALIAS "IDirectInputDevice8_GetCapabilities" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpDIDevCaps AS DIDEVCAPS) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IDirectInputDevice8_GetCapabilities(pthis, lpDIDevCaps) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EnumObjects method
' Enumerates the input and output objects available on a device.
' HRESULT EnumObjects(
'    LPDIENUMDEVICEOBJECTSCALLBACK lpCallback,
'    LPVOID pvRef,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_EnumObjects ALIAS "IDirectInputDevice8_EnumObjects" ( _
    BYVAL pthis AS DWORD PTR, BYVAL lpCallback AS DWORD, BYVAL pvRef AS DWORD, _
    BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[4] USING IDirectInputDevice8_EnumObjects(pthis, lpCallback, pvRef, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetProperty method
' Retrieves information about the input device.
' HRESULT GetProperty(
'    REFGUID rguidProp,
'    LPDIPROPHEADER pdiph
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetProperty ALIAS "IDirectInputDevice8_GetProperty" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguidProp AS GUID, BYVAL pdiph AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[5] USING IDirectInputDevice8_GetProperty(pthis, rguidProp, pdiph) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetProperty method
' Sets properties that define the device behavior. These properties include input buffer
' size and axis mode.
' HRESULT SetProperty(
'    REFGUID rguidProp,
'    LPCDIPROPHEADER pdiph
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SetProperty ALIAS "IDirectInputDevice8_SetProperty" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguidProp AS GUID, BYVAL pdiph AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[6] USING IDirectInputDevice8_SetProperty(pthis, rguidProp, pdiph) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Acquire method
' Obtains access to the input device.
' HRESULT Acquire(VOID);
' ****************************************************************************************
FUNCTION IDirectInputDevice8_Acquire ALIAS "IDirectInputDevice8_Acquire" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING IDirectInputDevice8_Acquire(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Unacquire method
' Releases access to the device.
' HRESULT Unacquire(VOID);
' ****************************************************************************************
FUNCTION IDirectInputDevice8_Unacquire ALIAS "IDirectInputDevice8_Unacquire" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[8] USING IDirectInputDevice8_Unacquire(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDeviceState method
' Retrieves immediate data from the device.
' HRESULT GetDeviceState(
'    DWORD cbData,
'    LPVOID lpvData
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetDeviceState ALIAS "IDirectInputDevice8_GetDeviceState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL cbData AS DWORD, BYVAL lpvData AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[9] USING IDirectInputDevice8_GetDeviceState(pthis, cbData, lpvData) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDeviceData method
' Retrieves buffered data from the device.
' HRESULT GetDeviceData(
'    DWORD cbObjectData,
'    LPDIDEVICEOBJECTDATA rgdod,
'    LPDWORD pdwInOut,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetDeviceData ALIAS "IDirectInputDevice8_GetDeviceData" ( _
    BYVAL pthis AS DWORD PTR, BYVAL cbObjectData AS DWORD, BYVAL rgdod AS DWORD, _
    BYREF pdwInOut AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[10] USING IDirectInputDevice8_GetDeviceData(pthis, cbObjectData, rgdod, pdwInOut, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetDataFormat method
' Sets the data format for the Microsoft DirectInput device.
' HRESULT SetDataFormat(
'    LPCDIDATAFORMAT lpdf
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SetDataFormat ALIAS "IDirectInputDevice8_SetDataFormat" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpdf AS DIDATAFORMAT) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[11] USING IDirectInputDevice8_SetDataFormat(pthis, lpdf) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetEventNotification method
' Specifies an event that is to be set when the device state changes. It is also used to
' turn off event notification.
' HRESULT SetEventNotification(
'    HANDLE hEvent
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SetEventNotification ALIAS "IDirectInputDevice8_SetEventNotification" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hEvent AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[12] USING IDirectInputDevice8_SetEventNotification(pthis, hEvent) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetCooperativeLevel method
' Establishes the cooperative level for this instance of the device. The cooperative level
' determines how this instance of the device interacts with other instances of the device
' and the rest of the system.
' HRESULT SetCooperativeLevel(
'    HWND hwnd,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SetCooperativeLevel ALIAS "IDirectInputDevice8_SetCooperativeLevel" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hwnd AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[13] USING IDirectInputDevice8_SetCooperativeLevel(pthis, hwnd, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetObjectInfo method
' Retrieves information about a device object, such as a button or axis.
' HRESULT GetObjectInfo(
'    LPDIDEVICEOBJECTINSTANCE pdidoi,
'    DWORD dwObj,
'    DWORD dwHow
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetObjectInfo ALIAS "IDirectInputDevice8_GetObjectInfo" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdidoi AS DIDEVICEOBJECTINSTANCEA, _
    BYVAL dwObj AS DWORD, BYVAL dwHow AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[14] USING IDirectInputDevice8_GetObjectInfo(pthis, pdidoi, dwObj, dwHow) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDeviceInfo method
' Obtains information about the device's identity.
' HRESULT GetDeviceInfo(
'    LPDIDEVICEINSTANCE pdidi
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetDeviceInfo ALIAS "IDirectInputDevice8_GetDeviceInfo" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdidi AS DIDEVICEINSTANCEA) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[15] USING IDirectInputDevice8_GetDeviceInfo(pthis, pdidi) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' RunControlPanel method
' Runs the Microsoft DirectInput control panel associated with this device. If the device
' does not have a control panel associated with it, the default device control panel is
' launched.
' HRESULT RunControlPanel(
'    HWND hwndOwner,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_RunControlPanel ALIAS "IDirectInputDevice8_RunControlPanel" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hwndOwner AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[16] USING IDirectInputDevice8_RunControlPanel(pthis, hwndOwner, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Initialize method
' Initializes a DirectInputDevice object. The IDirectInput8::CreateDevice method
' automatically initializes a device after creating it; applications normally do not need
' to call this method.
' HRESULT Initialize(
'    HINSTANCE hinst,
'    DWORD dwVersion,
'    REFGUID rguid
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_Initialize ALIAS "IDirectInputDevice8_Initialize" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hinst AS DWORD, BYVAL dwVersion AS DWORD, _
    BYREF rguid AS GUID) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[17] USING IDirectInputDevice8_Initialize(pthis, hinst, dwVersion, rguid) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateEffect method
' Creates and initializes an instance of an effect identified by the effect globally
' unique identifier (GUID).
' HRESULT CreateEffect(
'    REFGUID rguid,
'    LPCDIEFFECT lpeff,
'    LPDIRECTINPUTEFFECT *ppdeff,
'    LPUNKNOWN punkOuter
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_CreateEffect ALIAS "IDirectInputDevice8_CreateEffect" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguid AS GUID, BYREF lpeff AS DIEFFECT, _
    BYREF ppdeff AS DWORD, BYVAL punkOuter AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[18] USING IDirectInputDevice8_CreateEffect(pthis, rguid, lpeff, ppdeff, punkOuter) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EnumEffects method
' Enumerates all the effects supported by the force-feedback system on the device. The
' enumerated globally unique identifiers (GUIDs) can represent predefined effects, as well
' as effects peculiar to the device manufacturer.
' HRESULT EnumEffects(
'    LPDIENUMEFFECTSCALLBACK lpCallback,
'    LPVOID pvRef,
'    DWORD dwEffType
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_EnumEffects ALIAS "IDirectInputDevice8_EnumEffects" ( _
    BYVAL pthis AS DWORD PTR, BYVAL lpCallback AS DWORD, BYVAL pvRef AS DWORD, _
    BYVAL dwEffType AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[19] USING IDirectInputDevice8_EnumEffects(pthis, lpCallback, pvRef, dwEffType) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetEffectInfo method
' Obtains information about an effect.
' HRESULT GetEffectInfo(
'    LPDIEFFECTINFO pdei,
'    REFGUID rguid
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetEFfectInfo ALIAS "IDirectInputDevice8_GetEFfectInfo" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdei AS DIEFFECTINFOA, BYREF rguid AS GUID) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[20] USING IDirectInputDevice8_GetEFfectInfo(pthis, pdei, rguid) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetForceFeedbackState method
' Retrieves the state of the device's force-feedback system.
' HRESULT GetForceFeedbackState(
'    LPDWORD pdwOut
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetForceFeedbackState ALIAS "IDirectInputDevice8_GetForceFeedbackState" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdwOut AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[21] USING IDirectInputDevice8_GetForceFeedbackState(pthis, pdwOut) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SendForceFeedbackState method
' Sends a command to the device's force-feedback system.
' HRESULT SendForceFeedbackCommand(
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SendForceFeedbackState ALIAS "IDirectInputDevice8_SendForceFeedbackState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[22] USING IDirectInputDevice8_SendForceFeedbackState(pthis, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EnumCreatedEffectObjects method
' Enumerates all the currently created effects for this device. Effects created by
' IDirectInputDevice8::CreateEffect are enumerated.
' HRESULT EnumCreatedEffectObjects(
'    LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
'    LPVOID pvRef,
'    DWORD fl
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_EnumCreatedEffectObjects ALIAS "IDirectInputDevice8_EnumCreatedEffectObjects" ( _
    BYVAL pthis AS DWORD PTR, BYVAL lpCallback AS DWORD, BYVAL pvRef AS DWORD, _
    BYVAL fl AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[23] USING IDirectInputDevice8_EnumCreatedEffectObjects(pthis, lpCallback, pvRef, fl) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Escape method
' Sends a hardware-specific command to the force-feedback driver.
' HRESULT Escape(
'    LPDIEFFESCAPE pesc
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_Escape ALIAS "IDirectInputDevice8_Escape" ( _
    BYVAL pthis AS DWORD PTR, BYREF pesc AS DIEFFESCAPE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[24] USING IDirectInputDevice8_Escape(pthis, pesc) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Poll method
' Retrieves data from polled objects on a Microsoft DirectInput device. If the device does
' not require polling, calling this method has no effect. If a device that requires
' polling is not polled periodically, no new data is received from the device. Calling
' this method causes DirectInput to update the device state, generate input events (if
' buffered data is enabled), and set notification events (if notification is enabled).
' HRESULT Poll(VOID);
' ****************************************************************************************
FUNCTION IDirectInputDevice8_Poll ALIAS "IDirectInputDevice8_Poll" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[25] USING IDirectInputDevice8_Poll(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SendDeviceData method
' Sends data to a device that accepts output.
' Note  There are no devices that accept output from IDirectInputDevice8::SendDeviceData.
' Applications should not use IDirectInputDevice8::SendDeviceData. Force Feedback is the
' recommended way to send data to a device. If you want to send other data to a device,
' such as changing LED or internal device states, the HID application programming
' interface (API) is the recommended way.
' HRESULT SendDeviceData(
'    DWORD cbObjectData,
'    LPCDIDEVICEOBJECTDATA rgdod,
'    LPDWORD pdwInOut,
'    DWORD fl
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SendDeviceData ALIAS "IDirectInputDevice8_SendDeviceData" ( _
    BYVAL pthis AS DWORD PTR, BYVAL cbObjectData AS DWORD, _
    BYVAL rgdod AS DWORD, BYREF pdwInOut AS DWORD, BYVAL fl AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[26] USING IDirectInputDevice8_SendDeviceData(pthis, cbObjectData, rgdod, pdwInOut, fl) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EnumEffectsInFile method
' Enumerates all the effects in a file created by the Force Editor utility or another
' application using the same file format.
' HRESULT EnumEffectsInFile(
'    LPCSTR lpszFileName,
'    LPENUMEFFECTSINFILECALLBACK pec,
'    LPVOID pvRef,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_EnumEffectsInFile ALIAS "IDirectInputDevice8_EnumEffectsInFile" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpszFileName AS ASCIIZ, BYVAL pec AS DWORD, _
    BYVAL pvRef AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[27] USING IDirectInputDevice8_EnumEffectsInFile(pthis, lpszFileName, pec, pvRef, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' WriteEffectToFile method
' Saves information about one or more force-feedback effects to a file that can be read by
' using IDirectInputDevice8::EnumEffectsInFile. This method is chiefly of interest to
' those wanting to write their own force-authoring applications.
' HRESULT WriteEffectToFile(
'    LPCSTR lpszFileName,
'    DWORD dwEntries,
'    LPCDIFILEEFFECT rgDiFileEft,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_WriteEffectToFile ALIAS "IDirectInputDevice8_WriteEffectToFile" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpszFileName AS ASCIIZ, BYVAL dwEntries AS DWORD, _
    BYVAL rgDiFileEft AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[28] USING IDirectInputDevice8_WriteEffectToFile(pthis, lpszFileName, dwEntries, rgDiFileEft, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' BuildActionMap method
' Builds an action map for the device and retrieves information about it.
' HRESULT BuildActionMap(
'    LPDIACTIONFORMAT lpdiaf,
'    LPCTSTR lpszUserName,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_BuildActionMap ALIAS "IDirectInputDevice8_BuildActionMap" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpdiaf AS DIACTIONFORMATA, _
    BYREF lpszUserName AS ASCIIZ, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[29] USING IDirectInputDevice8_BuildActionMap(pthis, lpdiaf, lpszUserName, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetActionMap method
' Sets the data format for a device and maps application-defined actions to device
' objects. It also sets the buffer size for buffered data.
' HRESULT SetActionMap(
'    LPCDIACTIONFORMAT lpdiActionFormat,
'    LPCSTR lpszUserName,
'    DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_SetActionMap ALIAS "IDirectInputDevice8_SetActionMap" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpdiActionFormat AS DIACTIONFORMATA, _
    BYREF lpszUserName AS ASCIIZ, BYVAL dwFlags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[30] USING IDirectInputDevice8_SetActionMap(pthis, lpdiActionFormat, lpszUserName, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetImageInfo method
' Retrieves information about a device image for use in a configuration property sheet.
' HRESULT GetImageInfo(
'    LPDIDEVICEIMAGEINFOHEADER lpdiDevImageInfoHeader
' );
' ****************************************************************************************
FUNCTION IDirectInputDevice8_GetImageInfo ALIAS "IDirectInputDevice8_GetImageInfo" ( _
    BYVAL pthis AS DWORD PTR, BYREF lpdiDevImageInfoHeader AS DIDEVICEIMAGEINFOHEADER) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[31] USING IDirectInputDevice8_GetImageInfo(pthis, lpdiDevImageInfoHeader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Wednesday, 15 March 2006 00:50:14 +0100