S
shaozen
Unregistered / Unconfirmed
GUEST, unregistred user!
unit About;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TAboutDlg = class(TForm)
GroupBox1: TGroupBox;
Image1: TImage;
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AboutDlg: TAboutDlg;
implementation
{$R *.dfm}
procedure TAboutDlg.Button1Click(Sender: TObject);
begin
Close();
end;
procedure TAboutDlg.FormCreate(Sender: TObject);
const
InfoNum = 10;
InfoStr: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');
var
S: string;
n, i: DWORD;
Buf: PChar;
Value: PChar;
Len:Uint;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem
;
//GetMem(Buf,n);
GetFileVersionInfo(PChar(S), 0, n, Buf);
Memo1.Lines.Add('VersionInfoSize = ' + IntToStr
);
for i := 1 to InfoNum do
if VerQueryValue(Buf,PChar('StringFileInfo/08040000/' + InfoStr), Pointer(Value), Len) then
Memo1.Lines.Add(InfoStr + ' = '+ Value);
FreeMem(Buf, n);
end
else
Memo1.Lines.Add('No version information found');
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TAboutDlg = class(TForm)
GroupBox1: TGroupBox;
Image1: TImage;
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AboutDlg: TAboutDlg;
implementation
{$R *.dfm}
procedure TAboutDlg.Button1Click(Sender: TObject);
begin
Close();
end;
procedure TAboutDlg.FormCreate(Sender: TObject);
const
InfoNum = 10;
InfoStr: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');
var
S: string;
n, i: DWORD;
Buf: PChar;
Value: PChar;
Len:Uint;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem
![Thumbs down (n) (n)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f44e.png)
//GetMem(Buf,n);
GetFileVersionInfo(PChar(S), 0, n, Buf);
Memo1.Lines.Add('VersionInfoSize = ' + IntToStr
![Thumbs down (n) (n)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f44e.png)
for i := 1 to InfoNum do
if VerQueryValue(Buf,PChar('StringFileInfo/08040000/' + InfoStr), Pointer(Value), Len) then
Memo1.Lines.Add(InfoStr + ' = '+ Value);
FreeMem(Buf, n);
end
else
Memo1.Lines.Add('No version information found');
end;
end.