Une petite question simple...
Comment avoir la version de son programme (dans le prgramme). On peut le mettre dans Option, mais j'aimerais l'afficher pas mon programme.
Version imprimable
Une petite question simple...
Comment avoir la version de son programme (dans le prgramme). On peut le mettre dans Option, mais j'aimerais l'afficher pas mon programme.
Tu fais appel à GetExeVersion(); pour avoir ton resultat où tu spécife un nom spécifique d'appli ou de dll.
Code:
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 function GetExeVersion(AFilePathName: string = ''): string; var dwInfoSize, // Size of VERSIONINFO structure dwVerSize, // Size of Version Info Data dwWnd: DWORD; // Handle for the size call. FI: PVSFixedFileInfo; // Delphi structure; see WINDOWS.PAS ptrVerBuf: Pointer; // pointer to a version buffer strVersion: string; // Holds parsed version number begin if AFilePathName = '' then AFilePathName := paramStr(0); dwInfoSize := getFileVersionInfoSize(pChar(AFilePathName), dwWnd); if (dwInfoSize = 0) then result := '' else begin getMem(ptrVerBuf, dwInfoSize); try if getFileVersionInfo(pChar(AFilePathName), dwWnd, dwInfoSize, ptrVerBuf) then if verQueryValue(ptrVerBuf, '\', pointer(FI), dwVerSize) then strVersion := format('%d.%d.%d.%d', [hiWord(FI.dwFileVersionMS), loWord(FI.dwFileVersionMS), hiWord(FI.dwFileVersionLS), loWord(FI.dwFileVersionLS)]); finally freeMem(ptrVerBuf); end; end; Result := strVersion; end;
Oups, j'ai dû mal chercher... :oops: