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.56 MB
Time: 0.022 c
4-22503
Yura
2001-11-05 20:11
2002.01.08
Enter a string in the window


14-22408
fliz
2001-11-08 15:24
2002.01.08
Is this a bug in Delphi ?! : ((


1-22067
DNT
2001-12-15 16:20
2002.01.08
Dialog & dll


1-22028
tovSuhov
2001-12-18 12:16
2002.01.08
Maybe someone knows ...


1-22002
BFG
2001-12-16 16:24
2002.01.08
Graphs





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