Recent

Author Topic: Application Icon shortcut  (Read 484 times)

johnmc

  • New Member
  • *
  • Posts: 47
Application Icon shortcut
« on: September 15, 2022, 03:35:26 pm »
Hi,
I using Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 x86_64-win64-win32/win64.
I have created an Icon for my application using Inkscape and exported the file to 128x128 pixel png file.
I can get the icon applied to the exe file, using the project options, but when I create a shortcut to the application and place it on the desktop the icon reverts to the paw. If I create the shortcut by right mouse on the exe file and create shortcut that file has the new icon but move that file to the desktop or use send to desktop and the icon reverts to the paw.
Selecting the shortcut and display the properties show the asocsiated icon to be the new one and selecting change icon also shows the new icon.

Any pointers would be a help.

John

KodeZwerg

  • Sr. Member
  • ****
  • Posts: 306
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Application Icon shortcut
« Reply #1 on: September 15, 2022, 03:47:24 pm »
Have you looked in correct folder?
I do have sometime the problem that Lazarus compile into \lib\ folder and sometime in root folder of project.
Maybe in your root is a old compiled .exe ?
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

lainz

  • Hero Member
  • *****
  • Posts: 3980
Re: Application Icon shortcut
« Reply #2 on: September 15, 2022, 03:55:44 pm »
Create 256x256, 48x48, 32x32, 16x16 icon sizes. You can use Greenfish Icon Editor that's made with Lazarus to create the .ico file.

Also Windows has the cached icopn of the exe applications, so maybe is loading the paw icon from the cache.

winni

  • Hero Member
  • *****
  • Posts: 3134
Re: Application Icon shortcut
« Reply #3 on: September 15, 2022, 05:14:02 pm »
Hi!

Assign the Icon also to the property Icon of the main form.

Winni

KodeZwerg

  • Sr. Member
  • ****
  • Posts: 306
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Application Icon shortcut
« Reply #4 on: September 15, 2022, 05:29:17 pm »
Assign the Icon also to the property Icon of the main form.
Hello Winni, can you explain a little what a forms icon has to do with the Shell Icon that the OS display?
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

winni

  • Hero Member
  • *****
  • Posts: 3134
Re: Application Icon shortcut
« Reply #5 on: September 15, 2022, 06:58:34 pm »
hi!

Have a look of this property of the form:

ShowInTaskbar = stNever | stAllways | stDefault

OK?

Winni


KodeZwerg

  • Sr. Member
  • ****
  • Posts: 306
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Application Icon shortcut
« Reply #6 on: September 15, 2022, 07:54:38 pm »
MainForm Icon will, if at all, displayed when you run an application.
Shell Icon will be loaded from OS within Resource Section of Executable ("MainIcon") and has absolute nothing to do with Forms, at least that's how it works on Windows.
I apology if my statement does not match for other OS.
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

winni

  • Hero Member
  • *****
  • Posts: 3134
Re: Application Icon shortcut
« Reply #7 on: September 15, 2022, 08:20:39 pm »
MainForm Icon will, if at all, displayed when you run an application.
Shell Icon will be loaded from OS within Resource Section of Executable ("MainIcon") and has absolute nothing to do with Forms, at least that's how it works on Windows.
I apology if my statement does not match for other OS.

Hi!

Windows exe-files have an icon by default.
Linux executables don't have that.

It was a hard road to implement that in Linux.
I think it was around Lazarus version 1.0
Try to find some ancient discussion.

Winni

KodeZwerg

  • Sr. Member
  • ****
  • Posts: 306
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Application Icon shortcut
« Reply #8 on: September 15, 2022, 08:48:59 pm »
Windows exe-files have an icon by default.
Hello Winni, sorry if i sound like i want to fight, that is not my intention, but i do full disagree to above statement.
When you do not include either by project options or with a selfmade ".res", thats a compiled resource file that be linked into .exe resource section, a "MainIcon"-Entry, than Windows will take its default Icon for executable files.
For Graphical applications Lazarus add its blue-looking fist symbol, yes, but that does not mean that it is a must to use it  O:-)

I added the 3 different windows icons that are not included in .exe, they come from a shell resource dll.
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

KodeZwerg

  • Sr. Member
  • ****
  • Posts: 306
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Application Icon shortcut
« Reply #9 on: September 15, 2022, 08:52:07 pm »
And thank you Winni for updating me about how Linux works with Icon/Symbol/Glyph however it is called there  :-*
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

johnmc

  • New Member
  • *
  • Posts: 47
Re: Application Icon shortcut
« Reply #10 on: September 16, 2022, 11:25:50 am »
Hi!

Assign the Icon also to the property Icon of the main form.

Winni

I have done this and no difference, and

hi!

Have a look of this property of the form:

ShowInTaskbar = stNever | stAllways | stDefault

OK?

Winni


I tried changing this from stDefault to stAlways but again no difference.

I have also tried clearing the cache. All to no avail.

 

TinyPortal © 2005-2018