Skip to content

Fix and improve CreateIconFromResource(Ex) and LookupIconIdFromDirectory(Ex) documentation - #2242

Open
DJm00n wants to merge 2 commits into
MicrosoftDocs:docsfrom
DJm00n:fix/createiconfromresource-input-format
Open

Fix and improve CreateIconFromResource(Ex) and LookupIconIdFromDirectory(Ex) documentation#2242
DJm00n wants to merge 2 commits into
MicrosoftDocs:docsfrom
DJm00n:fix/createiconfromresource-input-format

Conversation

@DJm00n

@DJm00n DJm00n commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

CreateIconFromResourceEx:

  • presbits: clarify the parameter accepts a single RT_ICON/RT_CURSOR image, not a
    resource group directory; redirect buffer format details to Remarks
  • fIcon: remove misplaced LOCALHEADER sentence (covered in the DIB format bullet in Remarks)
  • cxDesired/cyDesired: clarify that zero without LR_DEFAULTSIZE uses the size stored in
    presbits without scaling, rather than vaguely "the actual resource size"
  • Flags: remove LR_SHARED — it does not produce sharing or caching for this function
    and makes the handle impossible to destroy; remove from keyword metadata as well
  • Remarks: replace boilerplate sentence with a proper description of the three accepted
    buffer formats (DIB, PNG, ANI/RIFF-ACON); add ANI sizing and fIcon-ignored notes

CreateIconFromResource:

  • presbits: redirect buffer format details to CreateIconFromResourceEx Remarks
  • fIcon: remove misplaced LOCALHEADER sentence
  • Remarks: remove boilerplate sentence; expand the wrapper description to explain the
    LR_DEFAULTSIZE consequence (always default system size) and how to get a specific size
  • Add Examples link

LookupIconIdFromDirectoryEx:

  • cxDesired/cyDesired: document that the SM_* metric is only used when LR_DEFAULTSIZE is
    set; without it, zero returns the first directory entry without size scoring
  • Flags table: add the missing LR_DEFAULTSIZE entry; fix LR_MONOCHROME description
    ("Searches for" rather than "Creates")
  • Add LR_DEFAULTSIZE to keyword metadata

LookupIconIdFromDirectory:

  • Description: clarify that this wrapper passes Flags=0 (not LR_DEFAULTSIZE), so it
    always returns the first directory entry without size scoring

Related: https://devblogs.microsoft.com/oldnewthing/?p=108925

DJm00n added 2 commits July 24, 2026 00:54
…ory(Ex) documentation

CreateIconFromResourceEx:
- presbits: clarify the parameter accepts a single RT_ICON/RT_CURSOR image, not a
  resource group directory; redirect buffer format details to Remarks
- fIcon: remove misplaced LOCALHEADER sentence (covered in the DIB format bullet in Remarks)
- cxDesired/cyDesired: clarify that zero without LR_DEFAULTSIZE uses the size stored in
  presbits without scaling, rather than vaguely "the actual resource size"
- Flags: remove LR_SHARED — it does not produce sharing or caching for this function
  and makes the handle impossible to destroy; remove from keyword metadata as well
- Remarks: replace boilerplate sentence with a proper description of the three accepted
  buffer formats (DIB, PNG, ANI/RIFF-ACON); add ANI sizing and fIcon-ignored notes

CreateIconFromResource:
- presbits: redirect buffer format details to CreateIconFromResourceEx Remarks
- fIcon: remove misplaced LOCALHEADER sentence
- Remarks: remove boilerplate sentence; expand the wrapper description to explain the
  LR_DEFAULTSIZE consequence (always default system size) and how to get a specific size
- Add Examples link

LookupIconIdFromDirectoryEx:
- cxDesired/cyDesired: document that the SM_* metric is only used when LR_DEFAULTSIZE is
  set; without it, zero returns the first directory entry without size scoring
- Flags table: add the missing LR_DEFAULTSIZE entry; fix LR_MONOCHROME description
  ("Searches for" rather than "Creates")
- Add LR_DEFAULTSIZE to keyword metadata

LookupIconIdFromDirectory:
- Description: clarify that this wrapper passes Flags=0 (not LR_DEFAULTSIZE), so it
  always returns the first directory entry without size scoring
@prmerger-automator

Copy link
Copy Markdown

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. @jwmsft

@prmerger-automator

Copy link
Copy Markdown

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. @jwmsft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant