65.9K
CodeProject is changing. Read more.
Home

CCodecList

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.23/5 (8 votes)

Sep 7, 2005

viewsIcon

36511

downloadIcon

585

A class that retrieves a list of Codecs found on the local computer using the registry.

What does the code do

CCodecList's class retrieves a list of Codecs found on the local computer using the registry.

How to use it

The Zip file contains a simple demo. Here it is:

#include "stdafx.h"
#include "CodecList.h"

CCodecList codec; // an object of CCodecList class

int main()
{
    system ("color 5F"); // color
    system ("title Codecs list using the registry..."); // a title

    int nb = codec.m_aCodec.GetCount(); // number of Codec(s)

    if(nb > 0) // Show a list only if at least one Codec is found.
    {
        // loop until we find a Codecs and show (it) them.
        for (int i = 0; i < codec.m_aCodec.GetCount(); i++)
        {
            printf("%s\r\n", codec.m_aCodec[i]);
        }

        printf("\r\n\r\n"); 

        // Here we show numbers of Codecs found.
        printf("--> Found %i Codecs installed on local computer.\r\n\r\n", 
                                           codec.m_aCodec.GetCount());
    }

    else // No Codecs found, inform user.
    {
        printf("No Codecs found.\r\n\r\n");
    }
    

    system("pause"); 
    return 0;
}

Restrictions

Tested and works on Windows XP SP1. To know: some Codecs' description aren't retrieved, like in the case for "ffdshow" and "mastroka". To retrieve more information about Codecs, you should use the WMI.