Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Resources
Icons
Icon Reference
Functions
 DestroyIcon Function
DestroyIcon Function

Destroys an icon and frees any memory the icon occupied.

Syntax

BOOL DestroyIcon(      
    HICON hIcon );

Parameters

hIcon
[in] Handle to the icon to be destroyed. The icon must not be in use.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Remarks

It is only necessary 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 function to destroy a shared icon. A shared icon is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared icon.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.

See Also

Icons Overview, CopyIcon, CreateIconFromResource, CreateIconFromResourceEx, CreateIconIndirect
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker