// mmddk.h
DWORD modMessage(
UINT uDeviceID,
UINT uMsg,
DWORD_PTR dwUser,
DWORD_PTR dwParam1,
DWORD_PTR dwParam2
);
View the official Windows hardware development documentationNo description available.
WINMM sends the MODM_GETPOS message to the modMessage function of a MIDI output driver to request the current position of the stream pointer in the data stream.
uDeviceID Specifies the ID of the target device. Device IDs are sequential and have an initial value of zero and a final value that is equal to one less than the number of devices that the driver supports.
uMsg WINMM sets this parameter to MODM_GETPOS when it calls modMessage to process this message.
dwUser Use this parameter to return instance data to the driver. Drivers that support multiple clients can use this instance data to track the client that is associated with the message.
dwParam1 Specifies a far pointer to an MMTIME structure.
dwParam2 Specifies the size, in bytes, of the MMTIME structure.
The modMessage function returns MMSYSERR_NOERROR if the operation is successful. Otherwise, it returns MMSYSERR_NOTENABLED to indicate that the driver failed to load or initialize.
The driver should return the position in the time format specified in the wType member of MMTIME. If the time format specified in wType is not supported, the driver must change wType to the default time format and return the position in that format.
Time is measured relative to the start of the first buffer that was sent while the driver was in the last stopped state. The stopped state is entered whenever a MODM_OPEN, MODM_RESET, or MODM_STOP message is received. Time spent between a MODM_PAUSE and the matching MODM_RESTART is not counted, but the clock should not be reset. Likewise, the time during which the driver is starved for data must not be counted; the returned time must be as if the stream played perfectly with no interruptions or pauses.
If the device is paused or starved, the time returned must be the time of the last event played.
| Target platform | Desktop |
| Version | Available in Windows XP and later Windows operating systems. |
| Header | Mmddk.h (include Mmddk.h, Mmsystem.h, or Windows.h) |