CopyIcon function

Copies the specified icon from another module to the current module.

Syntax


HICON WINAPI CopyIcon(
  _In_  HICON hIcon
);

Parameters

hIcon [in]

Type: HICON

A handle to the icon to be copied.

Return value

Type: HICON

If the function succeeds, the return value is a handle to the duplicate icon.

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

Remarks

The CopyIcon function enables an application or DLL to get its own handle to an icon owned by another module. If the other module is freed, the application icon will still be able to use the icon.

Before closing, an application must call the DestroyIcon function to free any system resources associated with the icon.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
CopyCursor
DestroyIcon
DrawIcon
DrawIconEx
Conceptual
Icons

 

 

Community Additions

ADD
Show:
© 2014 Microsoft