This message requests information about the format of the IOProc. MMIO provides a list of MMFORMATINFO structures containing descriptive information about the formats supported by currently installed IOProcs; for example, the format name, the FOURCC identifier, and related information. If this message is not defined in the IOProc or the IOProc does not handle the request successfully, mmioGetFormatInfo creates a blank MMFORMATINFO structure and attaches it to the internal list. It is recommended to hard-code the actual format information in the IOProc message handler code for the ulStructLen, fccIOProc, ulMediaType, and ulFlags fields. In addition, store other information (ulCodePage, ulLanguage, lNameLength, and aulDefaultFormatExt if any) in a resource file for NLS considerations.

The following example shows an example of how the M-Motion IOProc supports the MMIOM_GETFORMATINFO message.

case MMIOM_GETFORMATINFO:
    {
    /***********************************************************
     * Declare local variables.
     ***********************************************************/
    PMMFORMATINFO       pmmformatinfo;

    /************************************************************
     * Set pointer to MMFORMATINFO structure.
     ************************************************************/
    pmmformatinfo = (PMMFORMATINFO) lParam1;

    /************************************************************
     * Fill in the values for the MMFORMATINFO structure.
     ************************************************************/
    pmmformatinfo->ulStructLen  = sizeof (MMFORMATINFO);
    pmmformatinfo->fccIOProc    = FOURCC_MMOT;
    pmmformatinfo->ulIOProcType = MMIO_IOPROC_FILEFORMAT;
    pmmformatinfo->ulMediaType  = MMIO_MEDIATYPE_IMAGE;

    pmmformatinfo->ulFlags      = MMIO_CANREADTRANSLATED        |
                                  MMIO_CANREADUNTRANSLATED      |
                                  MMIO_CANWRITETRANSLATED       |
                                  MMIO_CANWRITEUNTRANSLATED     |
                                  MMIO_CANREADWRITEUNTRANSLATED |
                                  MMIO_CANSEEKTRANSLATED        |
                                  MMIO_CANSEEKUNTRANSLATED;

    strcpy ((PSZ) pmmformatinfo->szDefaultFormatExt, pszMotionExt);
    if (GetNLSData( &pmmformatinfo->ulCodePage,
                    &pmmformatinfo->ulLanguage ))
       {
       return( -1L );
       }

    if (GetFormatStringLength( FOURCC_MMOT,
                               &(pmmformatinfo->lNameLength) ))
       {
       return( -1L );
       }


    /************************************************************
     * Return success back to the application.
     ************************************************************/
    return (MMIO_SUCCESS);
    } /* end case of MMIOM_GETFORMATINFO */


[Back] [Next]