On Monday, 18 May 2020 at 17:20:17 UTC, BoQsc wrote:
It would be great if we could change/customise the icon of the Command line application that run the HelloWorld application. But I have a bad feeling that it is probably not possible without a GUI library.

Forever thankful to Adam D. Ruppe
It is possible to embed icon into the Windows executable.
The Original Adam's thread: https://forum.dlang.org/post/enrmidvsfdugqmudo...@forum.dlang.org

The instructions:
Download a valid Windows 3.0 icon resource
Examples: http://files.alexmeub.com.s3.amazonaws.com/other/win98_icons.zip

Download the tools to embed the Icon for the .exe executable.
http://ftp.digitalmars.com/bup.zip

Create a new text file named whatever.rc with the content similar to this:

IDI_ICON1       ICON    DISCARDABLE     "iconfil.ico"

Use rcc.exe tool and whatever.rc file to generate whatever.res file.
rcc.exe whatever.rc

Use dmd.exe compiler to embed newly created whatever.res file into your .exe file while compiling:
dmd.exe whatever.res

You should see that the newly compiled .exe file is now with an Icon.
And when launched the icon will be used by the Command Prompt.




Reply via email to