See Also: NativeWindow Members
This class automatically manages window class creation and registration.
A window is not eligible for garbage collection when it is associated with a window handle. To ensure proper garbage collection, handles must either be destroyed manually using NativeWindow.DestroyHandle or released using NativeWindow.ReleaseHandle.
The NativeWindow.ReleaseHandle method is called when the WM_NCDESTROY message is processed. This means there are cases in which when you do not need to manually call NativeWindow.ReleaseHandle, but it is good practice to do so.
The System.Windows.Forms.NativeWindow class provides the following properties and methods to manage handles: NativeWindow.Handle, NativeWindow.CreateHandle(CreateParams), NativeWindow.AssignHandle(IntPtr), NativeWindow.DestroyHandle, and NativeWindow.ReleaseHandle.