Home
Top.Mail.Ru Yandeks.Metrika
Forum: "WinAPI";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Display version * .exe Find similar branches


Skiv   (2001-11-05 09:55) [0]

Can I read the file I believe without using third-party
component (classes) of type RX, LMD.



Digitman   (2001-11-05 10:27) [1]

Can. All of these components ultimately address WINAPI calls.
GetFileVersionInfo, GetFileVersionInfoSize, VerQueryValue. As, by the way, all the other components: they all access the API from the inside (more correctly, the components encapsulate the API functions).



Dimka Maslov   (2001-11-05 11:02) [2]

type // File version record type PFileVersion = ^ TFileVersion; TFileVersion = record HiVersion: Integer; // Major version number LoVersion: Integer; // Minor version number Release: Integer; Build: Integer; end; function FileVersion (const FileName: TString = ""): TFileVersion; var S: TString; hMem: HGLOBAL; Buf: pointer; BufSize, Len, dwHandle: DWORD; VerInfo: PVSFixedFileInfo; pszName: PAnsiChar; begin FillChar (Result, SizeOf (Result), 0); S: = FileName; CleanUp (S, True); if IsEmptyStr (S) then S: = ParamStr (0); pszName: = @ S [1]; BufSize: = GetFileVersionInfoSize (pszName, dwHandle); if BufSize <> 0 then begin hMem: = GlobalAlloc (GHND, BufSize); if hMem = 0 then OutOfMemoryError; Buf: = GlobalLock (hMem); if Buf = nil then OutOfMemoryError; GetFileVersionInfo (pszName, dwHandle, BufSize, Buf); VerQueryValue (Buf, "\", pointer (VerInfo), Len); with VerInfo ^ do begin Result.HiVersion: = HiWord (dwFileVersionMS); Result.LoVersion: = LoWord (dwFileVersionMS); Result.Release: = HiWord (dwFileVersionLS); Result.Build:=LoWord(dwFileVersionLS); end; GlobalUnlock (hMem); GlobalFree (hMem); end else Result.HiVersion: = - 1; end;



Dimka Maslov   (2001-11-05 11:06) [3]

In the example you need to remove CleanUp (S, True)a call IsEmptyStr (S)replaced by S = "", TString on string



Pages: 1 whole branch

Forum: "WinAPI";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.81 MB
Time: 0.022 c
14-22410
fint
2001-11-08 15:10
2002.01.08
Try


1-22115
Derzky
2001-12-19 18:14
2002.01.08
How to compare dates and the difference between them to get an integer


1-22247
as
2001-12-17 11:29
2002.01.08
Help someone can .....


1-22093
Bristol
2001-12-19 11:59
2002.01.08
sending letters using Delphi 5


14-22379
Felix
2001-11-05 19:54
2002.01.08
Show me - Maybe not? -Show you say!





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish