determine number of resources in a file

Posted on 2009-12-21
Last Modified: 2013-11-11

i know , in delphi 7, i can do this to extract one resource named "ResourceName" from currently running app,

  rStream := TResourceStream;

  rStream := TResourceStream.Create(0, 'ResourceName', RT_RCDATA);

but how to extract all resource files within a resource type,, how to determine their number, names or if one exists or not ??

Question by:AgentAmine
    1 Comment
    LVL 25

    Accepted Solution

    check this :

    and here is an example to use it :

    be aware that in this example, the function that adds all resources found to the list adds a space before all names, and for the resources that are not named but only have an ID, they are marked with a # and ID number

    I striped the spaces in the function below :
    function enumResNamesProc(module: HMODULE; restype, resname: PChar;
      list: TStrings): Integer; stdcall;
      if HiWord(Cardinal(resname)) <> 0 then
        list.Add(Format('#%d', [loword(Cardinal(resname))]));
      Result := 1;

    Open in new window


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    This algorithm (in C#) will resize any image down to a given size while maintaining the original aspect ratio. The maximum width and max height are both optional but if neither are given, the original image is returned. This example is designed t…
    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now