The following code illustrates how to play a device from 5 to 25 seconds with the time format set to milliseconds.

   USHORT          usDeviceID;
   MCI_PLAY_PARMS  mpp;

   /* Play from 5 seconds to 25 seconds (time format set to
      milliseconds)                                                    */

   /* Assign hwndCallback the handle to the PM Window routine          */
   mpp.hwndCallback = (HWND) hwndMyWindow;

   mpp.ulFrom = (ULONG) 5000;       /* Play from this position         */
   mpp.ulTo = (ULONG) 25000;        /* Play to this position           */

   mciSendCommand(usDeviceID,       /* Device ID                       */
                   MCI_PLAY,        /* MCI play message                */
                   MCI_NOTIFY | MCI_FROM | MCI_TO,
                                    /* Flags for this message          */
                   (PVOID) &mpp,    /* Data structure                  */
                   0);              /* No user parm                    */



[Back] [Next]