DLL versiyon numarasını kod ile nasıl görebiliriz.Arama yaptım ama alakasız konular çıktı.


Kod: Tümünü seç
function VersiyonSNo: string;
const
NOVIDATA = '';
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
strFileName, // Name of the file to check
strVersion: string; // Holds parsed version number
begin
strFileName := 'C:\WINDOWS\vmmreg32.dll';
dwInfoSize := getFileVersionInfoSize(pChar(strFileName), dwWnd);
if (dwInfoSize = 0) then result := NOVIDATA
else
begin
getMem(ptrVerBuf, dwInfoSize);
try
if getFileVersionInfo(pChar(strFileName), 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;
Kod: Tümünü seç
function VersiyonSNo: string;
const
NOVIDATA = '';
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
strFileName, // Name of the file to check
strVersion: string; // Holds parsed version number
begin
strFileName := 'C:\Documents and Settings\XP\Desktop\DLL VER\ortak\EBynGndr.dll';
dwInfoSize := getFileVersionInfoSize(pChar(strFileName), dwWnd);
if (dwInfoSize = 0) then result := NOVIDATA
else
begin
getMem(ptrVerBuf, dwInfoSize);
try
if getFileVersionInfo(pChar(strFileName), 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;