Recent

Author Topic: change application icon  (Read 948 times)

Paolo

  • Hero Member
  • *****
  • Posts: 675
change application icon
« on: December 21, 2025, 07:11:53 pm »
Hello,

I have successfully converted from Deplhi some app of mine, however the icon is still the delphi one, whatever I try in project option.

any suggestion ?

win-10/laz 4.2.

Thanks

Paolo

  • Hero Member
  • *****
  • Posts: 675
Re: change application icon
« Reply #1 on: December 21, 2025, 07:17:36 pm »
to be more precise : on windows view with small icon i see picture 1 with greater icon  greater I see picture 2  :o

Thaddy

  • Hero Member
  • *****
  • Posts: 18676
  • Jungle wars. And failing health it seems.
Re: change application icon
« Reply #2 on: December 21, 2025, 07:40:36 pm »
delete the res and do a build.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Paolo

  • Hero Member
  • *****
  • Posts: 675
Re: change application icon
« Reply #3 on: December 21, 2025, 07:43:37 pm »
already tried.. nothing.

Paolo

  • Hero Member
  • *****
  • Posts: 675
Re: change application icon
« Reply #4 on: December 21, 2025, 07:47:56 pm »
now the problem is disappeared, maybe a refresh problem of windows ???? (even if for sure I deleted the folder and pressed F5 several times).  :o

LeP

  • Jr. Member
  • **
  • Posts: 95
Re: change application icon
« Reply #5 on: December 21, 2025, 09:10:29 pm »
The problem is Windows, which caches the icon. For me (and not only in Delphi) the icon sometimes stays the same for hours (and if I move the .exe to a virtual machine, the icon is correct).

Now it doesn't bother me anymore; I know the icon is correct.

Paolo

  • Hero Member
  • *****
  • Posts: 675
Re: change application icon
« Reply #6 on: December 21, 2025, 09:22:34 pm »
Ok, it seems the case.

creaothceann

  • Sr. Member
  • ****
  • Posts: 250
Re: change application icon
« Reply #7 on: December 21, 2025, 09:52:35 pm »
Other file managers may also do their own icon caching, for example Total Commander.

anse

  • New Member
  • *
  • Posts: 46
  • Bugmonkey
    • HeidiSQL
Re: change application icon
« Reply #8 on: December 22, 2025, 12:35:20 pm »
Windows caches icons in your user profile. You can delete these

%userprofile%\AppData\Local\Microsoft\Windows\Explorer\iconcache_*.db

You will need to reboot afterwards. Even then this is not a 100% solution, there may be file type associations or your theme/icon pack which override the icons.

What a mess.

Thaddy

  • Hero Member
  • *****
  • Posts: 18676
  • Jungle wars. And failing health it seems.
Re: change application icon
« Reply #9 on: December 22, 2025, 02:05:07 pm »
Simpler (Windows only):
Code: Pascal  [Select][+][-]
  1. program refreshiconcache;
  2. uses windows,shellapi;
  3.  
  4. procedure RefreshIcons;  
  5. begin
  6.     // Notify shell that file associations have changed
  7.     SHChangeNotify(
  8.         SHCNE_ASSOCCHANGED,  // Event: associations changed
  9.         SHCNF_IDLIST,        // No path needed
  10.         nil,
  11.         nil
  12.     );
  13. end;
  14.  
  15. begin
  16.   RefreshIcons;
  17. end.
Full program, handy function...
This forces the shell to reload the icons.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Zoran

  • Hero Member
  • *****
  • Posts: 1980
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: change application icon
« Reply #10 on: December 23, 2025, 01:07:28 am »
Full program, handy function...
This forces the shell to reload the icons.

Nice and useful, thanks!
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

 

TinyPortal © 2005-2018