procedure TForm2.Button3Click(Sender: TObject);
var
DisplayName:
string;
i:integer;
h : hIcon;
S :
String;
Icon : TIcon;
lIndex: Integer;
begin
openDialog := TOpenDialog.Create(self);
openDialog.InitialDir := GetCurrentDir;
openDialog.Options := [ofFileMustExist];
openDialog.Filter := '
Anwendungen|*.exe';
openDialog.FilterIndex := 0;
if OpenDialog1.Execute
then
for i:=0
to OpenDialog1.Files.Count -1
do
begin
lIndex := Length(MeinArray);
SetLength(MeinArray, lIndex + 1);
MeinArray[lIndex].RealFileName := OpenDialog1.FileName;
MeinArray[lIndex].DisplayName := DisplayName;
ListBox1.Items.Add(MeinArray[lIndex].DisplayName);
begin
DisplayName := ExtractFileName(Opendialog1.Files[i]);
if (InputQuery('
Programmname','
Bitte geben sie ein neuen Namen ein:',DisplayName))
AND (DisplayName <> '
')
then
begin
Listbox1.Items.AddObject(DisplayName,TObject(Opendialog1.Files[i]));
SetLength(DisplayName,i +0);
// Notwendig? Normal nicht..oder?
SetLength(S, +0);
// siehe oben..
begin
ImageList1.GetIcon(0, Icon);
Image1.Canvas.Draw(0, 0, Icon);
Icon := TIcon.Create;
Form2.ImageList1.AddIcon (Icon);
S := OpenDialog1.FileName;
h := IconFromFile(Form2.OpenDialog1.FileName,0);
Label2.Caption := ListBox1.Items.Text;
Label9.Caption := GetFileVersion(s);
end;
with
Image1.Canvas
Do
DrawIconEx(
Handle, 0, 0,h, 32, 32, 0, Brush.Handle, di_Normal);
begin
//ImageList1.Clear;
Label3.Caption := s;
FreeAndNil(Icon);
end;
Image1.Refresh;
end;
end;
end;
end;