Do I need to call DestroyIcon if I did this using LoadIconWithScaleDown?

I create icons in my application using LoadIconWithScaleDown(). I will also return to CreateIconFromResourceEx()if the preferred feature is not available.

The documentation for DestroyIcon()states:

You only need to call DestroyIcon for icons and cursors created with the following functions: CreateIconFromResourceEx (if called without the LR_SHARED flag), CreateIconIndirect and CopyIcon. Do not use this feature for a common icon. The common icon is valid as the module from which it was loaded remains in memory. The following functions receive a common icon.

  • LoadIcon
  • LoadImage (if you use the LR_SHARED flag)
  • CopyImage (if you use the flag LR_COPYRETURNORG and hImage is a common icon)
  • CreateIconFromResource
  • CreateIconFromResourceEx (if you use the LR_SHARED flag)

Note. I do not pass LR_SHAREDin CreateIconFromResourceEx(); perhaps I should.

What would I like to know, do I need to call DestroyIcon()for icons made with LoadIconWithScaleDown()?

+5
source share
1 answer

, , HICON, , -, . Windows, , , , , , , LR_SHARED, , , , .

+2

All Articles