Add support to respond to the PGN_CALCSIZE version of the WM_NOTIFY
[wine] / programs / avitools / icinfo.c
1 #include <stdio.h>
2 #include <string.h>
3 #include "windows.h"
4 #include "mmsystem.h"
5 #include "vfw.h"
6
7
8 int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
9 {
10     int n=0,doabout=0,doconfigure=0;
11     char        buf[128],type[5],handler[5];
12     HMODULE     msvfw32 = LoadLibrary("msvfw32.dll");
13
14 BOOL  (VFWAPI  *fnICInfo)(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
15 LRESULT (VFWAPI *fnICClose)(HIC hic);
16 HIC     (VFWAPI *fnICOpen)(DWORD fccType, DWORD fccHandler, UINT wMode);
17 LRESULT (VFWAPI *fnICGetInfo)(HIC hic,ICINFO *picinfo, DWORD cb);
18 LRESULT (VFWAPI *fnICSendMessage)(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
19
20 #define XX(x) fn##x = (void*)GetProcAddress(msvfw32,#x);
21         XX(ICInfo);
22         XX(ICOpen);
23         XX(ICClose);
24         XX(ICGetInfo);
25         XX(ICSendMessage);
26 #undef XX
27
28     if (strstr(cmdline,"-about"))
29         doabout = 1;
30     if (strstr(cmdline,"-configure"))
31         doconfigure = 1;
32
33     printf("Currently installed Video Compressors:\n");
34     while (1) {
35         ICINFO  ii;
36         HIC     hic;
37
38         ii.dwSize = sizeof(ii);
39         if (!fnICInfo(ICTYPE_VIDEO,n++,&ii))
40             break;
41         if (!(hic=fnICOpen(ii.fccType,ii.fccHandler,ICMODE_QUERY)))
42             continue;
43         if (!fnICGetInfo(hic,&ii,sizeof(ii))) {
44             fnICClose(hic);
45             continue;
46         }
47 #define w2s(w,s) WideCharToMultiByte(0,0,w,-1,s,128,0,NULL)
48
49         w2s(ii.szName,buf);
50         memcpy(type,&(ii.fccType),4);type[4]='\0';
51         memcpy(handler,&(ii.fccHandler),4);handler[4]='\0';
52         printf("%s.%s: %s\n",type,handler,buf);
53         printf("\tdwFlags: 0x%08lx (",ii.dwFlags);
54 #define XX(x) if (ii.dwFlags & x) printf(#x" ");
55         XX(VIDCF_QUALITY);
56         XX(VIDCF_CRUNCH);
57         XX(VIDCF_TEMPORAL);
58         XX(VIDCF_COMPRESSFRAMES);
59         XX(VIDCF_DRAW);
60         XX(VIDCF_FASTTEMPORALC);
61         XX(VIDCF_FASTTEMPORALD);
62         XX(VIDCF_QUALITYTIME);
63 #undef XX
64         printf(")\n");
65         printf("\tdwVersion: 0x%08lx\n",ii.dwVersion);
66         printf("\tdwVersionICM: 0x%08lx\n",ii.dwVersionICM);
67         w2s(ii.szDescription,buf);
68         printf("\tszDescription: %s\n",buf);
69         if (doabout) ICAbout(hic,0);
70         if (doconfigure && ICQueryConfigure(hic))
71                 ICConfigure(hic,0);
72         fnICClose(hic);
73     }
74     return 0;    
75 }
76