开发者

Delphi: Organize RCData into hierarchy way

开发者 https://www.devze.com 2023-01-19 23:15 出处:网络
The following print screen shows list of reso开发者_开发百科urces file embedded into the package. Is it possible to organize the highlighted resources (SE_BUG...SY_VIEW) into hierarchy way ? What i me

The following print screen shows list of reso开发者_开发百科urces file embedded into the package. Is it possible to organize the highlighted resources (SE_BUG...SY_VIEW) into hierarchy way ? What i mean here is that can I create a folder call Metadata under the folder RCData and move all the highlighted resources (SE_BUG...SY_VIEW) into the Metadata folder ? In other words, I want to achieve the highlighted resources in well organized such as the way of MainIcon folder.

Delphi: Organize RCData into hierarchy way


the RCData is a type of resource not a folder. so you must use another type of resource to see the data in another folder.

This is the list of the types of resources available in delphi wich is based in the Windows Resources types.

const
  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);

the MAINICON folder in your sample image is a RT_GROUP_ICON, wich represent a group of icons with different sizes and colors, because that they appear like a folder.


Resource files don't have a structure. All you have is a bunch of resources that are identified by two parameters: Name and resource type.
The icon resource you see is of type "ICON" and is named "MAINICON" and is just an icon file. And icon files allow multiple images to be part of a single resource file. So what you're seeing is not the structure of the resource but the structure of the icon file as a special resource. The resource explorer is just capable of detecting these special resource files and thus displays them in this special way.
So basically, you have a main icon which only contains an icon of 32x32 pixels x32-bits colors. If you'd used an icon file that contains multiple images, you would have seen more in that list.


The Resource Explorer demo comes with source code, so yes, you can. :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消