taskmgr: Make stuff static.
[wine] / programs / icinfo / icinfo.c
1 /*
2  * Copyright 1999 Marcus Meissner
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include <stdio.h>
20 #include <string.h>
21 #include "windows.h"
22 #include "mmsystem.h"
23 #include "vfw.h"
24
25
26 int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
27 {
28     int n=0,doabout=0,doconfigure=0;
29     char        buf[128],type[5],handler[5];
30
31     if (strstr(cmdline,"-about"))
32         doabout = 1;
33     if (strstr(cmdline,"-configure"))
34         doconfigure = 1;
35
36     printf("Currently installed Video Compressors:\n");
37     while (1) {
38         ICINFO  ii;
39         HIC     hic;
40
41         ii.dwSize = sizeof(ii);
42         if (!ICInfo(ICTYPE_VIDEO,n++,&ii))
43             break;
44         if (!(hic=ICOpen(ii.fccType,ii.fccHandler,ICMODE_QUERY)))
45             continue;
46         if (!ICGetInfo(hic,&ii,sizeof(ii))) {
47             ICClose(hic);
48             continue;
49         }
50 #define w2s(w,s) WideCharToMultiByte(0,0,w,-1,s,128,0,NULL)
51
52         w2s(ii.szName,buf);
53         memcpy(type,&(ii.fccType),4);type[4]='\0';
54         memcpy(handler,&(ii.fccHandler),4);handler[4]='\0';
55         printf("%s.%s: %s\n",type,handler,buf);
56         printf("\tdwFlags: 0x%08x (",ii.dwFlags);
57 #define XX(x) if (ii.dwFlags & x) printf(#x" ");
58         XX(VIDCF_QUALITY);
59         XX(VIDCF_CRUNCH);
60         XX(VIDCF_TEMPORAL);
61         XX(VIDCF_COMPRESSFRAMES);
62         XX(VIDCF_DRAW);
63         XX(VIDCF_FASTTEMPORALC);
64         XX(VIDCF_FASTTEMPORALD);
65         XX(VIDCF_QUALITYTIME);
66 #undef XX
67         printf(")\n");
68         printf("\tdwVersion: 0x%08x\n",ii.dwVersion);
69         printf("\tdwVersionICM: 0x%08x\n",ii.dwVersionICM);
70         w2s(ii.szDescription,buf);
71         printf("\tszDescription: %s\n",buf);
72         if (doabout) ICAbout(hic,0);
73         if (doconfigure && ICQueryConfigure(hic))
74                 ICConfigure(hic,0);
75         ICClose(hic);
76     }
77     return 0;
78 }