Tips Trik Delphi - Menghitung Total Icon pada File | opxbit.web.id

Menghitung Total Icon pada File

Menghitung total icon pada File EXE, OCX, DLL, CPL dan ICL.

Deklarasi fungsi:

function TotalIkon(NamaFile: String) : Integer;
var
   LIcon  : HIcon;
   sIcon  : HIcon;
begin
   lIcon := 0;
   sIcon := 0;
   Result := ExtractIconEx(PChar(NamaFile), -1, LIcon, sIcon, 0);
end;

Contoh implementasi:

procedure TForm1.Button1Click(Sender: TObject);
var
  F: String;
begin
  if OpenDialog1.Execute then
  begin
    F:= OpenDialog1.FileName;
    Label1.Caption:= 'Total : ' + IntToStr(TotalIkon(F));
  end;
end;

Tambahkan unit ShellAPI pada klausa uses.

Output:

Belajar Delphi - Menghitung Total Icon pada File

Sample


Source Code Delphi - Menghitung Total Icon pada FileDownload
Source Code Delphi - Menghitung Total Icon pada File
File: total_icon.zip
Hits: 154


VN:F [1.9.6_1107]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)