Mega Code Archive

 
Categories / Delphi / Examples
 

Incorrect application icon

Question: Windows shows the wrong icon for my application in the Windows Explorer and on Short Cuts. When my application is run however, the correct icon appears on the Task Bar and in the Alt-Tab list. Answer: When Windows shows the default icon for an application in a Short Cut or in the Window's Explorer it uses the first icon resource that appears in the executable file. Icon resources that are linked into an application are ordered alphabetically. The resource name that Delphi uses for an application's icon is "MAINICON". If you link additional icon resources into your application you will need to make sure to name them so that they are ordered alphabetically after the resource name "MAINICON". The correct icon appears when the application is launched because in the window creation and registration process the icon resource name for the application is specified explicitly.