Crypt Library Demo 1.00
|
00001 /* 00002 Module : VersionInfo.H 00003 Purpose: Interface for an MFC class encapsulation of "Version Infos" 00004 Created: PJN / 10-04-2000 00005 00006 Copyright (c) 2000 - 2008 by PJ Naughter (Web: www.naughter.com, Email: pjna@naughter.com) 00007 00008 All rights reserved. 00009 00010 Copyright / Usage Details: 00011 00012 You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) 00013 when your product is released in binary form. You are allowed to modify the source code in any way you want 00014 except you cannot modify the copyright details at the top of each module. If you want to distribute source 00015 code with your application, then you are only allowed to distribute versions released by the author. This is 00016 to maintain a single distribution point for the source code. 00017 00018 */ 00019 00020 00022 00023 #pragma once 00024 00025 #ifndef __VERSIONINFO_H__ 00026 #define __VERSIONINFO_H__ 00027 00028 #ifndef CVERSIONINFO_EXT_CLASS 00029 #define CVERSIONINFO_EXT_CLASS 00030 #endif 00031 #ifndef CVERSIONINFO_EXT_API 00032 #define CVERSIONINFO_EXT_API 00033 #endif 00034 00035 00037 00038 class CVERSIONINFO_EXT_CLASS CVersionInfo 00039 { 00040 public: 00041 struct TRANSLATION 00042 { 00043 WORD m_wLangID; //e.g. 0x0409 LANG_ENGLISH, SUBLANG_ENGLISH_USA 00044 WORD m_wCodePage; //e.g. 1252 Codepage for Windows:Multilingual 00045 }; 00046 00047 //Constructors / Destructors 00048 CVersionInfo(); 00049 ~CVersionInfo(); 00050 00051 //methods: 00052 BOOL Load(LPCTSTR szFileName); 00053 VS_FIXEDFILEINFO* GetFixedFileInfo(); 00054 DWORD GetFileFlagsMask(); 00055 DWORD GetFileFlags(); 00056 DWORD GetOS(); 00057 DWORD GetFileType(); 00058 DWORD GetFileSubType(); 00059 FILETIME GetCreationTime(); 00060 unsigned __int64 GetFileVersion(); 00061 unsigned __int64 GetProductVersion(); 00062 CString GetValue(const CString& sKeyName); 00063 CString GetComments(); 00064 CString GetCompanyName(); 00065 CString GetFileDescription(); 00066 CString GetFileVersionAsString(); 00067 CString GetInternalName(); 00068 CString GetLegalCopyright(); 00069 CString GetLegalTrademarks(); 00070 CString GetOriginalFilename(); 00071 CString GetPrivateBuild(); 00072 CString GetProductName(); 00073 CString GetProductVersionAsString(); 00074 CString GetSpecialBuild(); 00075 int GetNumberOfTranslations(); 00076 TRANSLATION* GetTranslation(int nIndex); 00077 void SetTranslation(int nIndex); 00078 00079 protected: 00080 //Methods 00081 void Unload(); 00082 00083 //Data 00084 WORD m_wLangID; //The current language ID of the resource 00085 WORD m_wCharset; //The current Character set ID of the resource 00086 ATL::CHeapPtr<BYTE> m_VerData; //Pointer to the version info blob 00087 TRANSLATION* m_pTranslations; //Pointer to the "\\VarFileInfo\\Translation" version info 00088 int m_nTranslations; //The number of translated version infos in the resource 00089 VS_FIXEDFILEINFO* m_pffi; //Pointer to the fixed size version info data 00090 }; 00091 00092 #endif //__VERSIONINFO_H__