Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop / MFC

CCodecList

2.23/5 (8 votes)
7 Sep 2005 1   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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here