System.Drawing.Icon.FromHandle Method

Creates a GDI+ System.Drawing.Icon from the specified Windows handle to an icon (HICON).

Syntax

public static Icon FromHandle (IntPtr handle)

Parameters

handle
A Windows handle to an icon.

Returns

The System.Drawing.Icon this method creates.

Remarks

When using this method, you must dispose of the original icon by using the DestroyIcon method in the Win32 API to ensure that the resources are released.

Requirements

Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0