Assembly: mscorlib (in mscorlib.dll)
A GCHandle object to retrieve an internal integer representation from.
Return ValueAn IntPtr object that represents a GCHandle object.
The following code example shows an App class that creates a handle to a managed object using the GCHandle.Alloc method, which prevents the managed object from being collected. A call to the EnumWindows method passes a delegate and a managed object (both declared as managed types, but not shown), and casts the handle to an IntPtr object. The unmanaged function passes the type back to the caller as a parameter of the callback function.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.