This documentation is archived and is not being maintained.

NativeWindow.FromHandle Method

Retrieves the window associated with the specified handle.

[Visual Basic]
Public Shared Function FromHandle( _
   ByVal handle As IntPtr _
) As NativeWindow
public static NativeWindow FromHandle(
 IntPtr handle
public: static NativeWindow* FromHandle(
 IntPtr handle
public static function FromHandle(
   handle : IntPtr
) : NativeWindow;


A handle to a window.

Return Value

The NativeWindow associated with the specified handle. This method returns a null reference (Nothing in Visual Basic) when the handle does not have an associated window.


If you receive a handle from another method, use this method to retrieve the window associated with the handle. The handle must already be owned by another NativeWindow in the current process, otherwise a null reference (Nothing in Visual Basic) is returned.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

NativeWindow Class | NativeWindow Members | System.Windows.Forms Namespace | NativeWindow | Handle | AssignHandle | CreateHandle | DestroyHandle | ReleaseHandle | WndProc