uLib  User mode C/C++ extended API library for Win32 programmers.
VerInfo.h
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 // Project: uLib - User mode utility library.
3 // Module: Fetch and display version data from VERSION resource.
4 // Author: Copyright (c) Love Nystrom
5 // License: NNOSL (BSD descendant, see NNOSL.txt in the base directory).
6 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 
8 #ifndef __VersionBox_h_incl__
9 #define __VersionBox_h_incl__
10 
11 #include <uLib/Common.h>
12 
14 
15 //+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 //+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25 
26 typedef void (__stdcall *PFnEnumVerStr)( CSTR Name, CSTR Val, PVOID UserData );
27 
33 
34 UINT EnumVersionStrings( PVOID vInfo, PFnEnumVerStr Action, PVOID UserData );
35 
45 
46 int AboutVerBox( HWND hOwner, LPCWSTR Caption, CSTR FName DEF_(NULL) );
47 
48 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49 // Easy access to version resource data.
50 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 
61 
62 PVOID GetVersionResource( HMODULE hMod, CSTR ResId, PUINT pSize );
63 
68 
69 PVOID LoadVersionInfo( CSTR FName, PDWORD pSize );
70 PVOID FreeVersionInfo( PVOID vInfo );
71 
74 
75 CSTR GetFixedVersionStr( IN PVOID vInfo );
76 
77 #if 0
78 
84 CSTR GetVersionStr( IN PVOID vInfo, IN CSTR BlockId, IN CSTR Name );
85 #endif
86 
94 
95 UINT GetVersionString(
96  IN PVOID VerBuf, IN CSTR BlockId, IN CSTR Name, OUT TSTR Buffer, IN UINT BufLen
97  );
98 
99 //==---------------------------------------------------------------------------
100 // Some common version strings that are usually present..
101 //==---------------------------------------------------------------------------
102 
103 CCSTR V_ProdName = _T("ProductName");
104 CCSTR V_ProdVer = _T("ProductVersion");
105 CCSTR V_Copyright = _T("LegalCopyright");
106 CCSTR V_Company = _T("CompanyName");
107 CCSTR V_Descript = _T("FileDescription");
108 CCSTR V_Comments = _T("Comments");
109 
110 //==---------------------------------------------------------------------------
118 //==---------------------------------------------------------------------------
119 
120 #pragma pack( push,2 )
121 typedef struct _viXlt
122 {
125 }
126 VXLT, *PVXLT;
127 #pragma pack( pop )
128 
132 
133 bool GetVerTranslations( IN PVOID vInfo, OUT PVXLT* ppXlt, OUT PUINT pCount );
134 
138 
139 CSTR GetVerTranslationStr( IN PVOID vInfo );
140 
141 // Two predefined common translations
142 
143 CCSTR V_EnUniBlock = _T("040904B0");
144 CCSTR V_EnMultiBlock = _T("040904E4");
145 
147 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149 #endif//ndef __VersionBox_h_incl__
150 // EOF
WORD Cp
IBM codepage.
Definition: VerInfo.h:124
bool GetVerTranslations(IN PVOID vInfo, OUT PVXLT *ppXlt, OUT PUINT pCount)
#define CSTR
Definition: Common.h:329
CSTR GetVerTranslationStr(IN PVOID vInfo)
unsigned short WORD
Definition: Common.h:413
CCSTR V_Company
Definition: VerInfo.h:106
#define TSTR
Definition: Common.h:328
CSTR GetVersionStr(PVOID VerBuf, CSTR BlockId, CSTR Name)
Definition: VerInfo.cpp:96
void(__stdcall * PFnEnumVerStr)(CSTR Name, CSTR Val, PVOID UserData)
Definition: VerInfo.h:26
int AboutVerBox(HWND hOwner, LPCWSTR Caption, CSTR FName=NULL)
Definition: VerInfo.cpp:326
const LPCTSTR CCSTR
Definition: Common.h:335
CCSTR V_Descript
Definition: VerInfo.h:107
CCSTR V_EnUniBlock
US English / Unicode.
Definition: VerInfo.h:143
CCSTR V_ProdVer
Definition: VerInfo.h:104
CCSTR V_EnMultiBlock
US English / Codepage 1252.
Definition: VerInfo.h:144
PVOID GetVersionResource(HMODULE hMod, CSTR ResId, PUINT pSize)
Definition: VerInfo.cpp:23
CCSTR V_ProdName
Definition: VerInfo.h:103
CSTR GetFixedVersionStr(IN PVOID vInfo)
CCSTR V_Copyright
Definition: VerInfo.h:105
#define DEF_(x)
Definition: Common.h:240
PVOID FreeVersionInfo(PVOID vInfo)
Definition: VerInfo.cpp:59
Common include; Added types, small "ubiquitous" utilities, et c.
#define END_EXTERN_C
Definition: Common.h:221
WORD Lang
Microsoft langage Id.
Definition: VerInfo.h:123
PVOID LoadVersionInfo(CSTR FName, PDWORD pSize)
Definition: VerInfo.cpp:29
#define BEGIN_EXTERN_C
Definition: Common.h:220
Definition: VerInfo.h:121
CCSTR V_Comments
Definition: VerInfo.h:108
UINT GetVersionString(IN PVOID VerBuf, IN CSTR BlockId, IN CSTR Name, OUT TSTR Buffer, IN UINT BufLen)
Get a specific version string.
Definition: VerInfo.cpp:133
unsigned long * PDWORD
Definition: Common.h:414
UINT EnumVersionStrings(PVOID vInfo, PFnEnumVerStr Action, PVOID UserData)
Definition: VerInfo.cpp:249