HICON CopyIcon(hinst, hicon) | |||||
HINSTANCE hinst; | /* handle of application instance | */ | |||
HICON hicon; | /* handle of icon to copy | */ |
The CopyIcon function copies an icon.
hinst
Identifies the instance of the module that will copy the icon.
hicon
Identifies the icon to be copied.
The return value is the handle of the duplicate icon if the function is successful. Otherwise, it is NULL.
When it no longer requires an icon, an application should destroy the icon, using the DestroyIcon function.
The CopyIcon function allows an application or dynamic-link library to accept an icon from another module. Because all resources are owned by the module in which they originate, a resource cannot be shared after the module is freed. CopyIcon allows an application to create a copy that the application then owns.