forked from g8bpq/OldLinBPQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetVersion.h
54 lines (41 loc) · 1.12 KB
/
GetVersion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
char VersionString[50]="";
char VersionStringWithBuild[50]="";
int Ver[4];
char TextVerstring[50] = "";
VOID GetVersionInfo(TCHAR * File)
{
#ifndef LINBPQ
HRSRC RH;
struct tagVS_FIXEDFILEINFO * HG;
char isDebug[40]="";
HMODULE HM;
#ifdef SPECIALVERSION
strcat(isDebug, SPECIALVERSION);
#endif
#ifdef _DEBUG
strcat(isDebug, "Debug Build");
#endif
HM=GetModuleHandle(File);
RH=FindResource(HM,MAKEINTRESOURCE(VS_VERSION_INFO),RT_VERSION);
HG=LoadResource(HM,RH);
(int)HG+=40;
Ver[0] = HIWORD(HG->dwFileVersionMS);
Ver[1] = LOWORD(HG->dwFileVersionMS);
Ver[2] = HIWORD(HG->dwFileVersionLS);
Ver[3] = LOWORD(HG->dwFileVersionLS);
sprintf(VersionString,"%d.%d.%d.%d %s",
HIWORD(HG->dwFileVersionMS),
LOWORD(HG->dwFileVersionMS),
HIWORD(HG->dwFileVersionLS),
LOWORD(HG->dwFileVersionLS),
isDebug);
sprintf(TextVerstring,"V%d.%d.%d.%d", Ver[0], Ver[1], Ver[2], Ver[3]);
sprintf(VersionStringWithBuild,"%d.%d.%d Build %d %s",
HIWORD(HG->dwFileVersionMS),
LOWORD(HG->dwFileVersionMS),
HIWORD(HG->dwFileVersionLS),
LOWORD(HG->dwFileVersionLS),
isDebug);
return;
#endif
}