1 2 /*3 This code shows how to get the file version of a exe.4 */5 unsignedlong m;
6 int n = GetFileVersionInfoSize(Application->ExeName.c_str(), &m);
7 if (n)
8 {
9 char * Info = newchar [n+1];
10 char * cisver;
11 unsignedint vel = 0;
12 int ii = GetFileVersionInfo(Application->ExeName.c_str(),
13 0, n, Info);
14 if (ii)
15 {
16 ii = VerQueryValue(Info,
17 TEXT("\\StringFileInfo\\040504E2\\FileVersion"),
18 (LPVOID *) &cisver, &vel);
19 if (ii)
20 {
21 AnsiString verze = AnsiString("Program Build No.: ") + cisver;
22 ListBox1->Items->Add(verze);
23 }
24 }
25 delete [] Info;
26 }