Jump to content

MCI_INFO

From EDM2

This message returns string information from a media device instance. This information describes static attributes of the device or the loaded media, rather than its capabilities.

Syntax

param1
ULONG ulParam1; /* Information flags. */

param2
PMCI_INFO_PARMS pParam2; /* Pointer to the MCI_INFO_PARMS data structure. */

Parameters

ulParam1 (ULONG) - input
This parameter can contain any of the following flags:
  • MCI_NOTIFY Posts a notification message when the action completes.
  • MCI_WAIT Does not return control until the action is completed.
  • MCI_INFO_PRODUCT Returns a description of the hardware associated with the device.
Device-Specific Extensions
  • MCI_INFO_FILE Returns the current file name (CD-XA, Sequencer, Wave Audio, Video Overlay).
  • MCI_CD_INFO_ID Returns the 8-byte disc ID (CD Audio).
  • MCI_CD_INFO_UPC Returns the disc's UPC/serial number (CD Audio, CD-XA).
  • MCI_DGV_INFO_VIDEO_FILE Returns the current digital video file name (Digital Video).
  • MCI_DGV_INFO_IMAGE_FILE Returns the current image file name (Digital Video).
  • MCI_DGV_INFO_TEXT Returns the display window caption (Digital Video).
  • MCI_VD_INFO_LABEL Returns the videodisc label (Videodisc).
  • MCI_OVLY_INFO_TEXT Returns the display window caption (Video Overlay).
pParam2 (PMCI_INFO_PARMS) - input
A pointer to the MCI_INFO_PARMS structure. The pszReturn field points to the buffer where the string is returned, and ulRetSize specifies the buffer size.

Returns

rc (ULONG) - returns
  • MCIERR_SUCCESS Command completed successfully.
  • MCIERR_INVALID_DEVICE_ID Invalid device ID.
  • MCIERR_INVALID_BUFFER The return buffer is too small.
  • MCIERR_FLAGS_NOT_COMPATIBLE More than one info flag was specified.
  • MCIERR_MISSING_FLAG A required flag was not specified.

Remarks

    • Only one flag** can be used per `MCI_INFO` message. If the provided buffer is too small for the returned string, the system returns `MCIERR_INVALID_BUFFER`, and the ulRetSize field is updated with the required buffer size.

Example Code

The following example illustrates how to retrieve the file name of the currently loaded media.

   #define  RETBUFSIZE 128

   USHORT   usDeviceID;
   CHAR     InfoRet [RETBUFSIZE];            /* Return string buffer     */
   MCI_INFO_PARMS  infoparms;

   /* Get the file name of the currently loaded file                     */

   infoparms.pszReturn = (PSZ) &InfoRet;     /* Pointer to return buffer */
   infoparms.ulRetSize = RETBUFSIZE;         /* Return buffer size        */

   mciSendCommand(usDeviceID,                /* Device ID                */
    MCI_INFO,                                /* MCI info message         */
    MCI_WAIT | MCI_INFO_FILE,                /* Flags for this message   */
    (PVOID) &infoparms,                      /* Data structure           */
    0);                                      /* No user parm             */

   /* infoparms.pszReturn now contains the name of the current file      */

Related Messages