Delphi 10.2 Create and use a resource file (total of 22 formats, Rcdata is a custom format)

Source: Internet
Author: User

   windows支持以下资源格式:
    • 1
    • 2
The following are the resource formats supported by Windows:Rt_cursor = Makeintresource (1);Rt_bitmap = Makeintresource (2);Rt_icon = Makeintresource (3);Rt_menu = Makeintresource (4);Rt_dialog = Makeintresource (5);rt_string = Makeintresource (6);rt_fontdir = Makeintresource (7); rt_font = Makeintresource (8); rt_accelerator = Makeintresource (9); rt_rcdata = Types.rt_rcdata;//makeintresource (10); rt_messagetable = Makeintresource (11); difference = 11; rt_group_cursor = Makeintresource (DWORD (rt_cursor + difference)); rt_group_icon = Makeintresource (DWORD (Rt_icon + difference)); rt_version = Makeintresource (16); rt_dlginclude = Makeintresource (17); rt_plugplay = Makeintresource (19); rt_vxd = Makeintresource (20); rt_anicursor = Makeintresource (21); rt_aniicon = Makeintresource (+);         
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21st
   虽然Windows 规定 RCDATA 用作自定义格式, 我们也可以自定义格式名称, 譬如本例(rc 文件):
    • 1
    • 2
"C:\Windows\notepad.exe"fastp myfile res/ceshi.fr3  //自定义为 myfile 格式
    • 1
    • 2
   从资源文件中提取并调用:
    • 1
    • 2
var  rs: TResourceStream;begin  rs := TResourceStream.Create(HInstance, ‘file01‘, RT_RCDATA);  .....  rs.Free;end;//调用自定义格式的资源文件var rs: TResourceStream;begin rs := TResourceStream.Create(HInstance, ‘fastp‘, ‘myfile‘); ..... rs.Free;end;
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

Reference: http://www.cnblogs.com/del/archive/2008/02/15/1069769.html

http://blog.csdn.net/rznice/article/details/77934632

Delphi 10.2 Create and use a resource file (total of 22 formats, Rcdata is a custom format)

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.