Register the file type and associate the program (2)

Source: Internet
Author: User

In the previous issue, we customized the icon file for the file type:

Registry. SetValue (,,);

If you need to define many file types (for example, a player needs to define avi, mp4, flv, and many other video format icons), you need a bunch of ico files. If the user of the program deletes an ico file one day, it will be displayed as the ugly default icon in Explorer. Therefore, it is a good method to package all ico files into exe files.

For how to package (compile) the ico file into the exe file, see compile multiple Icon files into the C # program.

Assume that we have compiled two icofiles into the guo.exe file. The first is the default icon of the exe, and the second icon is the Guo. ico above. Then, the above Code should be changed:

Registry. SetValue (,,);

Worker uses the second icon of guo.exe as the default icon. Note that the subscript here starts from 1 rather than from 0.

The same is true for using dll as a resource file;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.