How do I change the program icon for a Delphi console application?
The application settings is greyed in a console application.
Bye.
if you add
application.Run;
somewhere in your dpr file you can use the project->options to change the icon. After you have changed the icon just remove "application.Run;" again and you can compile/build with new icon.
If the option to change the icon is disabled, then it is because you have deleted or neglected to add the following line from your DPR file:
{$R *.res}
Put it back, or add it if you never had it. The icon setting will be re-enabled, as will the version-information settings. If the resource file does not exist, then the IDE will create it for you. Do not edit that resource file (such as to add your own icons or other resources); it is for the IDE's use only.
According to a July 2007 blog article by Nibu Thomas, there seems to be a SetConsoleIcon
WinAPI function.
Alternatively just put the icon in a resource file. Windows should use the first icon it encounters in the application's resources as the application icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With