c0smyn Posted February 1, 2009 Report Posted February 1, 2009 Adaugati sus la uses: ShellApiAdaugati aceasta function sub {$R *.dfm}// Thanks to Shockerfunction ExtractIconFromExe(ExePath: string; SaveIconTo: string): boolean;vari: TIcon;h: HIcon;beginif not directoryexists(ExtractFilePath(SaveIconTo)) thenif MessageBox(application.Handle,PChar('Calea salvarii icoanei nu exista!'+#13#10+'Doriti ca aceasta sa fie creata?'),PChar('Icon Extractor'),MB_YESNO + MB_ICONEXCLAMATION) = ID_YES thenCreateDirectory(PChar(ExtractFilePath(SaveIconTo)),nil)elseexit;i := TIcon.Create;h := ExtractIcon(application.handle,PChar(ExePath),0);if h <> 0 then begini.Handle := h;i.SaveToFile(SaveIconTo);result := true;endelseresult := false;i.Free;end;Enjoy Quote
c0smyn Posted February 10, 2009 Author Report Posted February 10, 2009 Ai dreptate Shocker// Thanks to Shockerfunction ExtractIconFromExe(ExePath: string; SaveIconTo: string): boolean;vari: TIcon;h: HIcon;beginif not directoryexists(ExtractFilePath(SaveIconTo)) thenif MessageBox(application.Handle,PChar('Calea salvarii icoanei nu exista!'+#13#10+'Doriti ca aceasta sa fie creata?'),PChar('Icon Extractor'),MB_YESNO + MB_ICONEXCLAMATION) = ID_YES thenCreateDirectory(PChar(ExtractFilePath(SaveIconTo)),nil)elseexit;i := TIcon.Create;h := ExtractIcon(application.handle,PChar(ExePath),0);if h <> 0 then begini.Handle := h;i.SaveToFile(SaveIconTo);result := true;endelseresult := false;i.Free;end;E mai bine acum ? Quote