Log in

View Full Version : Codec About window in VirtualDub


88keyz
4th January 2008, 15:51
In VirtualDub when you are in the "Select video compression" screen there is an About button which displays version info about the codec you have selected.

http://img72.imageshack.us/img72/3962/vdubaboutup9.th.png (http://img72.imageshack.us/img72/3962/vdubaboutup9.png)

I'm positive that this is just a generic rundll32.exe command of some sort but I can't find any info on it. Does anyone know what command line command will give you the About window for codec files like DivX.dll and xvidvfw.dll?

Inventive Software
4th January 2008, 16:20
The command for most codecs to invoke the Configure box is rundll32.exe xvidvfw.dll,Configure. I dunno what the About command would be, but try replacing "Configure" with "About". Or, have a look at the VirtualDub source.

unskinnyboy
4th January 2008, 17:18
C:\WINDOWS\system32\rundll32.exe xvidvfw.dll,Configure About

squid_80
4th January 2008, 18:27
It's actually a call to the codec's driverproc function with ICM_ABOUT passed as the message, commonly performed using the ICAbout() macro. But before you do that you should do ICQueryAbout() to see if the codec actually supports displaying an about dialog.

Xvid exports the Configure function so you can get to it that way with rundll32 but don't expect that to be standard behaviour for codecs.

MasterNobody
4th January 2008, 18:38
88keyz
This functionality is not generic rundll32.exe command. I think, XviD is rare one which support this (by command line which unskinnyboy written) by exporting "Configure" function. But most of the codecs not support this (among them is DivX) and even configuration dialog. For correct showing this window your need get DriverProc function from DLL and write something like this:
{
if (DriverProc(0, 0, DRV_LOAD, 0, 0))
{
DWORD dwDriverId;
dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0);
if (dwDriverId != (DWORD)NULL)
{
DriverProc(dwDriverId, 0, ICM_ABOUT, (LPARAM)GetDesktopWindow(), 0);
DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0);
}
DriverProc(0, 0, DRV_FREE, 0, 0);
}
}

stegre
4th January 2008, 22:15
Here, try this (http://www.ftyps.com/unrelated/vfwquery/vfwquery.zip), I just wrote it. Source is pasted below (or complete VS 2003 source solution is here (http://www.ftyps.com/unrelated/vfwquery/vfwquerysrc.zip)).

http://www.ftyps.com/unrelated/vfwquery/wquery.png


// VfwQuery.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <vfw.h>

#define VIDC_TYPE 0x63646976 // "vidc"

int _tmain(int argc, _TCHAR* argv[])
{
BOOL bNeedsUsage, bWantsAboutDlg = FALSE, bWantsConfigDlg = FALSE;

bNeedsUsage = (argc < 2) || (argc > 3);

printf ("VFWQuery v1.0\r\n\r\n");

if (argc == 3)
{
bWantsAboutDlg = (wcscmp(argv[2], L"-a") == 0);
bWantsConfigDlg = (wcscmp(argv[2], L"-c") == 0);
bNeedsUsage = (!bWantsAboutDlg && !bWantsConfigDlg);
}

if (bNeedsUsage)
{
printf("Usage: VFWQuery <4cc> [-a] [-c]\r\n\r\n");
//
printf("<4cc>: The four letter \"fourcc\" code associated with codec.\r\n");
printf("With no flags, displays the codec name and driver path if it exists.\r\n");
printf("-a = also bring up the \"about\" dialog for the codec, if supported.\r\n");
printf("-c = also bring up the \"configure\" dialog for the codec, if supported.\r\n\r\n");
//
printf("Example: VFWQuery cvid -a\r\n");
printf("will show info and display the \"about\" dialog for the Cinepak Codec.\r\n");
}
else
{
char sz4cc[5];
wcstombs(sz4cc, argv[1], sizeof(sz4cc));

DWORD dwCC4 = *((DWORD*)(sz4cc));
HIC hic;
ICINFO icinfo;
bool bHasAboutDlg, bHasConfigDlg;

hic = ICOpen(VIDC_TYPE, dwCC4, ICMODE_QUERY);

if (hic == NULL)
printf("No VFW codec associated with 4cc \"%s\" found.\r\n", sz4cc);
else
{
bHasAboutDlg = (ICAbout(hic, -1) != (DWORD)ICERR_UNSUPPORTED);
bHasConfigDlg = (ICConfigure(hic, -1) != (DWORD)ICERR_UNSUPPORTED);

if (ICGetInfo(hic, &icinfo, sizeof(icinfo)) == 0)
printf("Error: Attempt to obtain info about the codec failed");
else
{
printf("Codec Name: %S\r\n", icinfo.szName);
printf("Description: %S\r\n", icinfo.szDescription);
printf("Driver file: %S\r\n", icinfo.szDriver);
printf("Has \"About\" dialog: %s\r\n", bHasAboutDlg ? "Yes" : "No");
printf("Has \"Config\" dialog: %s\r\n", bHasConfigDlg ? "Yes" : "No");
}

if (bWantsAboutDlg && bHasAboutDlg)
ICAbout(hic, NULL);

if (bWantsConfigDlg && bHasConfigDlg)
ICConfigure(hic, NULL);

ICClose(hic);
}
}
}

88keyz
5th January 2008, 02:36
All replies much appreciated. My question has been answered. Extra thanks to unskinnyboy and stegre for your specific answers and extra effort, way to go above and beyond.

:thanks: