Invalid exe application icon with resource files

I am studying a resource file (.Res) and found a useful tutorial at delphi.about.com.

Tutorial link: http://delphi.about.com/od/objectpascalide/l/aa113099a.htm

Download the test project: http://delphi.about.com/library/aboutres.zip

I found out that the application icon is different in Windows Explorer. The icon in the application form is displayed correctly (see Image 2). The icon on the Windows taskbar displays correctly (see Image 3).

But the icon does not display correctly in Windows Explorer when I view it (see image 1). This is not the MAINICON from the Res file.

Any idea what's wrong with him? What do I need to configure in order to get the correct application icon with a .EXE file?

  • Environment Delphi XE3
  • Windows 7 environment
  • You can download the sample project from the link above.

Image No. (1)

EXE Application icon is wrong in Windows Explorer

Image No. (2)

Application icon appears correctly on the task bar

Image No (3)

Application icon appears correctly on the form

Thanks in advance

+4
source share
2 answers

Without a hint of displaying the icon, the shell selects the one with the lowest identifier, or the first that comes in alphabetical order. There are three icons in your executable file: ICOFOLD, ICOOK, and MAINICON. ICOFOLD is the one that should be displayed in the shell folder.

The taskbar or form icon is set by sending messages WM_SETICONafter starting your program. Therefore, there is no guesswork.

+4
source

, .

Windows, , , . Windows Explorer. . .

+1

Source: https://habr.com/ru/post/1540307/


All Articles