The Winamp Remote Control suite
a remote control client and plugin for Winamp 2.x, 5.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DetailsF.cpp
Go to the documentation of this file.
1 /*
2 winamp remote control suite ŠPatrick Michael Martin 2000, 2001, 2002
3 
4 Copyright (C) 2000,2001,2002 Patrick M. Martin
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 Patrick M. Martin may be reached by email at patrickmmartin@gmail.com.
21 */
22 
23 #include <vcl.h>
24 #pragma hdrstop
25 
26 #include "DetailsF.h"
27 #include "VersionInfoU.h"
28 #include "remotestrs.h"
29 
30 
31 #pragma package(smart_init)
32 #pragma resource "*.dfm"
33 
34 
35 
37 
38 __fastcall TfrmDetails::TfrmDetails(TComponent* Owner)
39  : TForm(Owner)
40 {
41 }
42 
43 
44 
45 void __fastcall TfrmDetails::FormCreate(TObject *)
46 {
47 
48  Icon->Handle = Application->Icon->Handle;
49  TModuleVersionInfo * VI;
50  char FileName[MAX_PATH + 1];
51 
52  const AnsiString ExtraKeys[] = {"Expected Versions", NULL};
53 
54  GetModuleFileName(HInstance, FileName, MAX_PATH);
55 
56 
57  Caption = AnsiString().sprintf( "%s details", LowerCase(ExtractFileName(FileName)).c_str());
58 
59  VI = new TModuleVersionInfo(FileName);
60  try
61  {
62 
63  TListItem * ListItem;
64  int i;
65  for (i = 0; i < MaxVersionKeys ; i++)
66  {
67  ListItem = lvDetails->Items->Add();
68  ListItem->Caption = VersionKeyNames[i];
69  ListItem->SubItems->Add(VI->Key[VersionKeyNames[i]]);
70  }
71 
72  for (i = 0; (ExtraKeys[i] != NULL) ; i++)
73  {
74  ListItem = lvDetails->Items->Add();
75  ListItem->Caption = ExtraKeys[i];
76  ListItem->SubItems->Add(VI->Key[ExtraKeys[i]]);
77  }
78 
79  }
80  __finally
81  {
82  delete VI;
83  }
84 
85 
86 }
87