zoukankan      html  css  js  c++  java
  • delphi 10.2 创建并使用资源文件(一共22种格式,RCDATA是自定义格式)

       windows支持以下资源格式:
    
    • 1
    • 2
    //下面是 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(22);
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
       虽然Windows 规定 RCDATA 用作自定义格式, 我们也可以自定义格式名称, 譬如本例(rc 文件):
    
    • 1
    • 2
    file01 RCDATA "C:Windows
    otepad.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

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

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

  • 相关阅读:
    Spring Boot 使用常见问题
    JPA 使用
    JPA 复杂查询
    Gitlab利用Webhook实现Push代码后的jenkins自动构建
    消息中间件的使用场景
    消息中间件资料整理
    js原生跨域--用script标签实现
    遍历类成员并赋值
    Spring boot 读取 application.properties 文件方法
    fastjson 进行json转实体类对象及一些常用操作
  • 原文地址:https://www.cnblogs.com/findumars/p/8207232.html
Copyright © 2011-2022 走看看