C language program custom ico icon and title

Copyright: please indicate the source! https://blog.csdn.net/ZouHuiDong/article/details/90320433

The default C language program icons are the same with the CMD, the title is the program path. In order to make the program more personalized, beautiful, can according to their needs custom icon and title.


Custom Icons

The materials used

  • VC6.0
  • ico a picture

PS: online image transfer ICO https://cn.office-converter.com/Free-Online-ICO-Convert

First of all:
choose to add resources in the toolbar above.
Here Insert Picture Description
In the dialog box, select the BitMap option, then Import add graphic assets, note that if you choose New is the new image resources.
Here Insert Picture Description
Then select a picture, click Import to add resources.
Here Insert Picture Description
After completion of the addition of resources to close the pop-up page, choose to save resources, after the name of the resource it can be changed. Figure IDI_ICON1 is just added ICO picture.
Here Insert Picture Description
Save the resource file, and then add the resource file in a directory on the left side, right bar.
Here Insert Picture Description
Here Insert Picture Description
After you add resources are displayed in the left column, you can get the program icon changed after compilation.
Here Insert Picture Description
After compiling the program icon to open the VC may not have changed, but the directory manually open the icon will appear normal.
Here Insert Picture Description


Custom Title

The required header file: <windows.h>
using the CMD command to change the title

system("title 标题");

Effect:
Here Insert Picture Description
can also dynamically set the title, it does not describe in detail here.

Guess you like

Origin blog.csdn.net/ZouHuiDong/article/details/90320433