線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1728
推到 Plurk!
推到 Facebook!

Get EXE File Version information

 
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-12-07 11:35:58 IP:163.31.xxx.xxx 未訂閱

Get EXE File Version information

//----------------------------------------------------------------------------
//                                         * presented by BlueWater Software *
//
//
//     << VerInfo Class >>
//
//  Get Version Infomation in the resource of 32bit file
//
//
//
// Copyright (C)1998 biac (biac@asahi-net.email.ne.jp)
//
// File: VerInfo.h
//
// Legend:
// 1998/01/18 First Release
//
//---------------------------------------------------------------------------
#ifndef VerInfoH
#define VerInfoH
 
class VerInfo{
public:
 VerInfo();
 
    // === PROPERTIES ===
    // FileName (read/write)
    //  file name in full path
    __property AnsiString FileName = {
     read = m_strGetFileName,
     write = m_SetFileName
 };
 
    // FixedFileVersion (read only)
    //  like "4.0.0.950"
    __property AnsiString FixedFileVersion = {
     read = m_strGetFixedFileVersion
 };
    // FixedProductVersion (read only)
    __property AnsiString FixedProductVersion = {
     read = m_strGetFixedProductVersion
 };
    // FixedFileFlags (read only)
    __property DWORD FixedFileFlags = {
     read = m_dwGetFixedFileFlags
 };
    // FixedFileOS (read only)
    __property DWORD FixedFileOS = {
     read = m_dwGetFixedFileOS
 };
    // FixedFileType (read only)
    __property DWORD FixedFileType = {
     read = m_dwGetFixedFileType
 };
    // FixedFileSubtype (read only)
    __property DWORD FixedFileSubtype = {
     read = m_dwGetFixedFileSubtype
 };
    // FixedFileDate (read only) --- not supported in Windows95/NT4 (?)
    __property FILETIME FixedFileDate = {
     read = m_ftGetFixedFileDate
 };
 
    // LangID (read only)
    __property WORD LangID = {
     read = m_wGetLangID
 };
    // CharsetID (read only)
    __property WORD CharsetID = {
     read = m_wGetCharsetID
 };
 
    // ProductName (read only)
    __property AnsiString ProductName = {
     read = m_strGetProductName
 };
 
    // ProductVersion (read only)
    __property AnsiString ProductVersion = {
     read = m_strGetProductVersion
 };
 
    // OriginalFilename (read only)
    __property AnsiString OriginalFilename = {
     read = m_strGetOriginalFilename
 };
 
    // FileDescription (read only)
    __property AnsiString FileDescription = {
     read = m_strGetFileDescription
 };
 
    // FileVersion (read only)
    __property AnsiString FileVersion = {
     read = m_strGetFileVersion
 };
 
    // CompanyName (read only)
    __property AnsiString CompanyName = {
     read = m_strGetCompanyName
 };
 
    // LegalCopyright (read only)
    __property AnsiString LegalCopyright = {
     read = m_strGetLegalCopyright
 };
 
    // LegalTrademarks (read only)
    __property AnsiString LegalTrademarks = {
     read = m_strGetLegalTrademarks
 };
 
    // InternalName (read only)
    __property AnsiString InternalName = {
     read = m_strGetInternalName
 };
 
    // PrivateBuild (read only)
    __property AnsiString PrivateBuild = {
     read = m_strGetPrivateBuild
 };
 
    // SpecialBuild (read only)
    __property AnsiString SpecialBuild = {
     read = m_strGetSpecialBuild
 };
 
    // Comments (read only)
    __property AnsiString Comments = {
     read = m_strGetComments
 };
         // LastError (read only)
    // result of GetLastError() in this class
    __property DWORD LastError = {
     read = m_dwGetLastError
 };
 
 
 
private:
 
    // property - ExeName -
 AnsiString m_strFileName;
 AnsiString m_strGetFileName(void);
 void m_SetFileName(AnsiString);
         // property - FixedFileVersion -
    VS_FIXEDFILEINFO m_stFileInfo;
 AnsiString m_strGetFixedFileVersion(void);
 
    // property - FixedProductVersion -
 AnsiString m_strGetFixedProductVersion(void);
 
    // property - FixedFileFlags -
    DWORD m_dwGetFixedFileFlags(void);
 
    // property - FixedFileOS -
    DWORD m_dwGetFixedFileOS(void);
 
    // property - FixedFileType -
    DWORD m_dwGetFixedFileType(void);
 
 // property - FixedFileSubtype -
    DWORD m_dwGetFixedFileSubtype(void);
 
 // property - FixedFileDate -
    FILETIME m_ftGetFixedFileDate(void);
         // property - LangID -
    WORD m_wLangID;
    WORD m_wGetLangID(void);
 
    // property - CharsetID -
    WORD m_wCharsetID;
    WORD m_wGetCharsetID(void);
         // property - ProductName -
    AnsiString m_strProductName;
    AnsiString m_strGetProductName(void);
 
    // property - ProductVersion -
    AnsiString m_strProductVersion;
    AnsiString m_strGetProductVersion(void);
 
    // property - OriginalFilename -
    AnsiString m_strOriginalFilename;
    AnsiString m_strGetOriginalFilename(void);
 
    // property - FileDescription -
    AnsiString m_strFileDescription;
    AnsiString m_strGetFileDescription(void);
 
    // property - FileVersion -
    AnsiString m_strFileVersion;
    AnsiString m_strGetFileVersion(void);
 
    // property - CompanyName -
    AnsiString m_strCompanyName;
    AnsiString m_strGetCompanyName(void);
 
    // property - LegalCopyright -
    AnsiString m_strLegalCopyright;
    AnsiString m_strGetLegalCopyright(void);
 
    // property - LegalTrademarks -
    AnsiString m_strLegalTrademarks;
    AnsiString m_strGetLegalTrademarks(void);
 
    // property - InternalName -
    AnsiString m_strInternalName;
    AnsiString m_strGetInternalName(void);
 
    // property - PrivateBuild -
    AnsiString m_strPrivateBuild;
    AnsiString m_strGetPrivateBuild(void);
 
    // property - SpecialBuild -
    AnsiString m_strSpecialBuild;
    AnsiString m_strGetSpecialBuild(void);
 
    // property - Comments -
    AnsiString m_strComments;
    AnsiString m_strGetComments(void);
         // property - LastError -
    DWORD m_dwLastError;
    DWORD m_dwGetLastError(void);
 
    // member functions
    void m_ClearData(void);
    void m_GetVerInfo(void);
};
 
//---------------------------------------------------------------------------
#endif     
 
//----------------------------------------------------------------------------
//                                         * presented by BlueWater Software *
//
//
//     << VerInfo Class >>
//
//  Get Version Infomation in the resource of 32bit file
//
//
//
// Copyright (C)1998 biac (biac@asahi-net.email.ne.jp)
//
// File: VerInfo.cpp
//
// Legend:
// 1998/01/18 First Release
//
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include 
#pragma hdrstop
 
#include "VerInfo.h"
 
//---------------------------------------------------------------------------
VerInfo::VerInfo()
{
 // initialize members
    m_ClearData();
 
 // set filename of this file
 this->FileName = Application->ExeName;
}
     //---------------------------------------------------------------------------
//
// property "FileName"
//
AnsiString VerInfo::m_strGetFileName()
{
 return m_strFileName;
}
 
void VerInfo::m_SetFileName(AnsiString strNewName)
{
 m_strFileName = strNewName;
 m_GetVerInfo();
}
     //---------------------------------------------------------------------------
//
// property "FixedFileVersion" (read only)
//  returns like "4.0.0.950"
//
AnsiString VerInfo::m_strGetFixedFileVersion(void)
{
 AnsiString s0((int)HIWORD(m_stFileInfo.dwFileVersionMS));
    AnsiString s1((int)LOWORD(m_stFileInfo.dwFileVersionMS));
 AnsiString s2((int)HIWORD(m_stFileInfo.dwFileVersionLS));
 AnsiString s3((int)LOWORD(m_stFileInfo.dwFileVersionLS));
 
 return (s0   "."   s1   "."   s2   "."   s3);
}
 
//---------------------------------------------------------------------------
//
// property "FixedProductVersion" (read only)
//  returns like "4.0.0.950"
//
AnsiString VerInfo::m_strGetFixedProductVersion(void)
{
 AnsiString s0((int)HIWORD(m_stFileInfo.dwProductVersionMS));
    AnsiString s1((int)LOWORD(m_stFileInfo.dwProductVersionMS));
 AnsiString s2((int)HIWORD(m_stFileInfo.dwProductVersionLS));
 AnsiString s3((int)LOWORD(m_stFileInfo.dwProductVersionLS));
 
 return (s0   "."   s1   "."   s2   "."   s3);
}
 
//---------------------------------------------------------------------------
//
// property "FixedFileFlags" (read only)
//
DWORD VerInfo::m_dwGetFixedFileFlags(void)
{
 return m_stFileInfo.dwFileFlags ;
}
 
//---------------------------------------------------------------------------
//
// property "FixedFileOS" (read only)
//
DWORD VerInfo::m_dwGetFixedFileOS(void)
{
 return m_stFileInfo.dwFileOS;
}
 
//---------------------------------------------------------------------------
//
// property "FixedFileType" (read only)
//
DWORD VerInfo::m_dwGetFixedFileType(void)
{
 return m_stFileInfo.dwFileType;
}
 
//---------------------------------------------------------------------------
//
// property "FixedFileSubtype" (read only)
//
DWORD VerInfo::m_dwGetFixedFileSubtype(void)
{
 return m_stFileInfo.dwFileSubtype;
}
 
//---------------------------------------------------------------------------
//
// property "FixedFileDate" (read only)
//
FILETIME VerInfo::m_ftGetFixedFileDate(void)
{
 FILETIME ft;
    ft.dwHighDateTime = m_stFileInfo.dwFileDateMS;
    ft.dwLowDateTime  = m_stFileInfo.dwFileDateLS;
 
 return ft;
}
     //---------------------------------------------------------------------------
//
// property "LangID" (read only)
//
WORD VerInfo::m_wGetLangID(void)
{
 return m_wLangID;
}
 
//---------------------------------------------------------------------------
//
// property "CharsetID" (read only)
//
WORD VerInfo::m_wGetCharsetID(void)
{
 return m_wCharsetID;
}
     //---------------------------------------------------------------------------
//
// property "ProductName" (read only)
//
AnsiString VerInfo::m_strGetProductName(void)
{
 return m_strProductName;
}
 
//---------------------------------------------------------------------------
//
// property "ProductVersion" (read only)
//
AnsiString VerInfo::m_strGetProductVersion(void)
{
 return m_strProductVersion;
}
 
//---------------------------------------------------------------------------
//
// property "OriginalFilename" (read only)
//
AnsiString VerInfo::m_strGetOriginalFilename(void)
{
 return m_strOriginalFilename;
}
 
//---------------------------------------------------------------------------
//
// property "FileDescription" (read only)
//
AnsiString VerInfo::m_strGetFileDescription(void)
{
 return m_strFileDescription;
}
 
//---------------------------------------------------------------------------
//
// property "FileVersion" (read only)
//
AnsiString VerInfo::m_strGetFileVersion(void)
{
 return m_strFileVersion;
}
 
//---------------------------------------------------------------------------
//
// property "LegalCopyright" (read only)
//
AnsiString VerInfo::m_strGetLegalCopyright(void)
{
 return m_strLegalCopyright;
}
 
//---------------------------------------------------------------------------
//
// property "CompanyName" (read only)
//
AnsiString VerInfo::m_strGetCompanyName(void)
{
 return m_strCompanyName;
}
 
//---------------------------------------------------------------------------
//
// property "LegalTrademarks" (read only)
//
AnsiString VerInfo::m_strGetLegalTrademarks(void)
{
 return m_strLegalTrademarks;
}
 
//---------------------------------------------------------------------------
//
// property "InternalName" (read only)
//
AnsiString VerInfo::m_strGetInternalName(void)
{
 return m_strInternalName;
}
 
//---------------------------------------------------------------------------
//
// property "PrivateBuild" (read only)
//
AnsiString VerInfo::m_strGetPrivateBuild(void)
{
 return m_strPrivateBuild;
}
 
//---------------------------------------------------------------------------
//
// property "SpecialBuild" (read only)
//
AnsiString VerInfo::m_strGetSpecialBuild(void)
{
 return m_strSpecialBuild;
}
 
//---------------------------------------------------------------------------
//
// property "Comments" (read only)
//
AnsiString VerInfo::m_strGetComments(void)
{
 return m_strComments;
}
     //---------------------------------------------------------------------------
//
// property "LastError" (read only)
//
DWORD VerInfo::m_dwGetLastError(void)
{
 return m_dwLastError;
}
     //---------------------------------------------------------------------------
void VerInfo::m_ClearData(void)
{
    ZeroMemory((void *)(&m_stFileInfo), sizeof(m_stFileInfo));
    m_wLangID = 0;
    m_wCharsetID = 0;
    m_strProductName = "";
    m_strProductVersion = "";
 m_strOriginalFilename = "";
 m_strFileDescription = "";
 m_strFileVersion = "";
 m_strCompanyName = "";
 m_strLegalCopyright = "";
 m_strLegalTrademarks = "";
 m_strInternalName = "";
 m_strPrivateBuild = "";
 m_strSpecialBuild = "";
 m_strComments = "";
 
 m_dwLastError = 0;
}
     //---------------------------------------------------------------------------
//
// Get Version Info from the file
//
void VerInfo::m_GetVerInfo(void)
{
 #define VERSION_INFO_KEY_ROOT TEXT("\\StringFileInfo\\")
 #define VERSION_INFO_KEY_TRANS TEXT("\\VarFileInfo\\Translation")
 
 const int NUM_VERSION_INFO_KEYS = 12;
 CONST static TCHAR   *VersionKeys[] = {
     TEXT("ProductName"),
     TEXT("ProductVersion"),
     TEXT("OriginalFilename"),
     TEXT("FileDescription"),
     TEXT("FileVersion"),
     TEXT("CompanyName"),
     TEXT("LegalCopyright"),
     TEXT("LegalTrademarks"),
     TEXT("InternalName"),
     TEXT("PrivateBuild"),
     TEXT("SpecialBuild"),
     TEXT("Comments")
 };
 
 typedef struct _VersionKeyInfo {
     TCHAR const *szKey;
     TCHAR       *szValue;
 } VKINFO, *LPVKINFO;
 VKINFO gVKArray[NUM_VERSION_INFO_KEYS];
 
 
 
    m_ClearData();
      // Get size of Version Info Buffer
 DWORD   dwHandle = 0; // always set zero
 DWORD dwLength;
 dwLength = GetFileVersionInfoSize(m_strFileName.c_str(), &dwHandle);
 if(1 > dwLength){
  m_dwLastError = GetLastError();
  return;        //*** not reached ***
 }
 
 // Allocate Version Info buffer
 HANDLE  hMem;
 LPVOID  lpvMem;
 hMem = GlobalAlloc(GMEM_MOVEABLE, dwLength);
 if(NULL == hMem){
  m_dwLastError = GetLastError();
  return;        //*** not reached ***
 }
 lpvMem = GlobalLock(hMem);
 if(NULL == lpvMem){
  m_dwLastError = GetLastError();
  GlobalUnlock(hMem);
  GlobalFree(hMem);
  return;        //*** not reached ***
 }
 
 // Get Version Info block to buffer
    BOOL fRet;
 fRet = GetFileVersionInfo( m_strFileName.c_str(),
            dwHandle,
                                 dwLength,
                                 (LPVOID)lpvMem
            );
 if(FALSE == fRet){
  m_dwLastError = GetLastError();
  GlobalUnlock(hMem);
  GlobalFree(hMem);
  return;        //*** not reached ***
 }
 
    // Get root block
 LPVOID  lpInfo;
 UINT cch;
 if(VerQueryValue(lpvMem, "\\", &lpInfo, &cch)){
        CopyMemory( (void*)&m_stFileInfo,
           (const void*)lpInfo,
                    sizeof(m_stFileInfo)
             );
    }
 else{
  m_dwLastError = GetLastError();
  GlobalUnlock(hMem);
  GlobalFree(hMem);
  return;        //*** not reached ***
 }
 
 // Get Translation
    AnsiString strLangID;
    AnsiString strCharset;
 if(VerQueryValue(lpvMem, VERSION_INFO_KEY_TRANS, &lpInfo, &cch)){
     m_wLangID    = ((WORD *)lpInfo)[0];
        m_wCharsetID = ((WORD *)lpInfo)[1];
  strLangID  =  strLangID.IntToHex((int)m_wLangID, 4);
  strCharset = strCharset.IntToHex((int)m_wCharsetID, 4);
 }
 else{
  m_dwLastError = GetLastError();
  GlobalUnlock(hMem);
  GlobalFree(hMem);
  return;        //*** not reached ***
 }
 AnsiString strVerInfoLangID(strLangID   strCharset);
 
 // Enumerate Version Info
 TCHAR   key[80];
 static TCHAR szNull[1] = TEXT("");
 for (UINT i = 0; i < NUM_VERSION_INFO_KEYS; i  ) {
  lstrcpy(key, VERSION_INFO_KEY_ROOT);
        lstrcat(key, strVerInfoLangID.c_str());
  lstrcat(key, "\\");
  lstrcat(key, VersionKeys[i]);
  gVKArray[i].szKey = VersionKeys[i];
 
  // If version info exists, and the key query is successful, add
  //  the value.  Otherwise, the value for the key is NULL.
  if(VerQueryValue(lpvMem, key, &lpInfo, &cch)){
      gVKArray[i].szValue = (char *)lpInfo;
  }
  else{
      gVKArray[i].szValue = szNull;
  }
 }
 m_strProductName      = gVKArray[0].szValue;
 m_strProductVersion   = gVKArray[1].szValue;
 m_strOriginalFilename = gVKArray[2].szValue;
    m_strFileDescription  = gVKArray[3].szValue;
    m_strFileVersion      = gVKArray[4].szValue;
    m_strCompanyName      = gVKArray[5].szValue;
    m_strLegalCopyright   = gVKArray[6].szValue;
    m_strLegalTrademarks  = gVKArray[7].szValue;
    m_strInternalName     = gVKArray[8].szValue;
    m_strPrivateBuild     = gVKArray[9].szValue;
    m_strSpecialBuild     = gVKArray[10].szValue;
    m_strComments         = gVKArray[11].szValue;
      // Release buffer
 GlobalUnlock(hMem);
 GlobalFree(hMem);
 
 m_dwLastError = GetLastError();
}
     //---------------------------------------------------------------------------
// END OF FILE
 
 
 
//----------------------------------------------------------------------------
//                                         * presented by BlueWater Software *
//
//    << TestVerInfo >>
//
//  Sample Program to Use VerInfo Class
//
//
// Copyright (C)1998 biac (biac@asahi-net.email.ne.jp)
//
// File: Unit1.h
//
// Legend:
// 1998/01/18 First Release
//
//----------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//----------------------------------------------------------------------------
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
//----------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:
 TButton *Button1;
 TMemo *Memo1;
 TButton *Button2;
 TOpenDialog *OpenDialog1;
 void __fastcall Button1Click(TObject *Sender);
 void __fastcall FormCreate(TObject *Sender);
 
 void __fastcall Button2Click(TObject *Sender);
private:
 void m_DispData(void);
    AnsiString m_strCopyright;
public:
 virtual __fastcall TForm1(TComponent *Owner);
};
//----------------------------------------------------------------------------
extern TForm1 *Form1;
//----------------------------------------------------------------------------
#endif     
 
 
 
 
 
//----------------------------------------------------------------------------
//                                         * presented by BlueWater Software *
//
//    << TestVerInfo >>
//
//  Sample Program to Use VerInfo Class
//
//
// Copyright (C)1998 biac (biac@asahi-net.email.ne.jp)
//
// File: Unit1.cpp
//
// Legend:
// 1998/01/18 First Release
//
//----------------------------------------------------------------------------
#include 
#pragma hdrstop
 
#include "Unit1.h"
 
//----------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm1 *Form1;
 
//----------------------------------------------------------------------------
#include "VerInfo.h"
VerInfo myVerInfo;
 
//----------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent *Owner)
 : TForm(Owner)
{
 // (no codes)
}
 
//----------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
 m_strCopyright = myVerInfo.LegalCopyright;
 m_DispData();
}
 
//----------------------------------------------------------------------------
// [OK]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 this->Close();
}
 
//----------------------------------------------------------------------------
// [File...]
void __fastcall TForm1::Button2Click(TObject *Sender)
{
 Form1->FormStyle = fsNormal;
 
 if(OpenDialog1->Execute()){
     myVerInfo.FileName = OpenDialog1->FileName;
        m_DispData();
    }
 
    Form1->FormStyle = fsStayOnTop;
}
 
//----------------------------------------------------------------------------
void TForm1::m_DispData(void)
{
    Memo1->Text =  "# VerInfo Class for C   Builder\r\n# "
          m_strCopyright   "\r\n\r\n";
 
    AnsiString strErr((int)myVerInfo.LastError);
 Memo1->Text = Memo1->Text    "FileName\t"
                         myVerInfo.FileName   "\r\n";
 Memo1->Text = Memo1->Text   "LastError\t"
                         strErr   "\r\n";
      // FIXEDFILEINFO
 Memo1->Text = Memo1->Text   "\r\n[FIXEDFILEINFO]\r\n";
 
 Memo1->Text = Memo1->Text   "FixedFileVersion\t"
                         myVerInfo.FixedFileVersion   "\r\n";
 Memo1->Text = Memo1->Text   "FixedProductVersion\t"
                         myVerInfo.FixedProductVersion   "\r\n";
 
 AnsiString strFileFlags;
    strFileFlags =  "0x"
          strFileFlags.IntToHex((int)myVerInfo.FixedFileFlags, 8);
 Memo1->Text = Memo1->Text   "FixedFileFlags\t"
                         strFileFlags   "\r\n";
 
 AnsiString strFileOS;
    strFileOS =  "0x"
          strFileOS.IntToHex((int)myVerInfo.FixedFileOS, 8);
 Memo1->Text = Memo1->Text   "FixedFileOS\t"
                         strFileOS   "\r\n";
 
 AnsiString strFileType;
    strFileType =  "0x"
          strFileType.IntToHex((int)myVerInfo.FixedFileType, 8);
 Memo1->Text = Memo1->Text   "FixedFileType\t"
                         strFileType   "\r\n";
 
 AnsiString strFileSubtype;
    strFileSubtype =  "0x"
          strFileSubtype.IntToHex((int)myVerInfo.FixedFileSubtype,
                            8);
 Memo1->Text = Memo1->Text   "FixedFileSubtype\t"
                         strFileSubtype   "\r\n";
 
    // FixedFileDate --- not supported in Windows95/NT4
 //FILETIME ft = myVerInfo.FixedFileDate;
    //FILETIME ftLocal;
    //FileTimeToLocalFileTime(&ft, &ftLocal);
    //SYSTEMTIME st;
    //FileTimeToSystemTime(&ftLocal, &st);
    //AnsiString strY(st.wYear);
    //AnsiString strM(st.wMonth);
    //AnsiString strD(st.wDay);
    //AnsiString strH(st.wHour);
    //AnsiString strN(st.wMinute);
    //AnsiString strS(st.wSecond);
 //Memo1->Text = Memo1->Text   "FixedFileDate\t"
    //         strY   "/"   strM   "/"   strD   " "
    //         strH   ":"   strN   ":"   strS   "\r\n";
      // VarFileInfo Block
 Memo1->Text = Memo1->Text   "\r\n[VarFileInfo]\r\n";
 
 AnsiString strLangID;
    strLangID = "0x"   strLangID.IntToHex((int)myVerInfo.LangID, 4);
 Memo1->Text = Memo1->Text   "LanguageID\t"
                         strLangID   "\r\n";
 
    AnsiString strCharsetID((int)myVerInfo.CharsetID);
 Memo1->Text = Memo1->Text   "CharsetID\t"
                         strCharsetID   "\r\n";
      // StringFileInfo Block
 Memo1->Text = Memo1->Text   "\r\n[StringFileInfo]\r\n";
 Memo1->Text = Memo1->Text   "ProductName\t\x22"
                         myVerInfo.ProductName   "\x22\r\n";
 Memo1->Text = Memo1->Text   "ProductVersion\t\x22"
                         myVerInfo.ProductVersion   "\x22\r\n";
 Memo1->Text = Memo1->Text   "OriginalFilename\t\x22"
                         myVerInfo.OriginalFilename   "\x22\r\n";
 Memo1->Text = Memo1->Text   "FileDescription\t\x22"
                         myVerInfo.FileDescription   "\x22\r\n";
 Memo1->Text = Memo1->Text   "FileVersion\t\x22"
                         myVerInfo.FileVersion   "\x22\r\n";
 Memo1->Text = Memo1->Text   "CompanyName\t\x22"
                         myVerInfo.CompanyName   "\x22\r\n";
 Memo1->Text = Memo1->Text   "LegalCopyright\t\x22"
                         myVerInfo.LegalCopyright   "\x22\r\n";
 Memo1->Text = Memo1->Text   "LegalTrademarks\t\x22"
                         myVerInfo.LegalTrademarks   "\x22\r\n";
 Memo1->Text = Memo1->Text   "InternalName\t\x22"
                         myVerInfo.InternalName   "\x22\r\n";
 Memo1->Text = Memo1->Text   "PrivateBuild\t\x22"
                         myVerInfo.PrivateBuild   "\x22\r\n";
 Memo1->Text = Memo1->Text   "SpecialBuild\t\x22"
                         myVerInfo.SpecialBuild   "\x22\r\n";
 Memo1->Text = Memo1->Text   "Comments\t\x22"
                         myVerInfo.Comments   "\x22\r\n";
}
 
//---------------------------------------------------------------------------
// END OF FILE
 
 
//----------------------------------------------------------------------------
//                                         * presented by BlueWater Software *
//
//    << TestVerInfo >>
//
//  Sample Program to Use VerInfo Class
//
//
// Copyright (C)1998 biac (biac@asahi-net.email.ne.jp)
//
// File: TestVerInfo.cpp
//
// Legend:
// 1998/01/18 First Release
//
//---------------------------------------------------------------------------
#include 
#pragma hdrstop
//---------------------------------------------------------------------------
USERES("TestVerInfo.res");
USEFORM("Unit1.cpp", Form1);
USEUNIT("VerInfo.cpp");
USERC("Version.rc");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
 Application->Initialize();
 Application->Title = "VerInfoClass";
  Application->CreateForm(__classid(TForm1), &Form1);
    Application->Run();
 
 return 0;
}
//---------------------------------------------------------------------------
// END OF FILE
 
聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
系統時間:2024-07-04 22:43:40
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!