CSharpTest.Net
FromHandle Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.WinForms Namespace > Win32Window Class : FromHandle Method

handle

Glossary Item Box

Constructs an IWin32Window from a valid handle or returns null if handle == IntPtr.Zero

Syntax

Visual Basic (Declaration) 
Public Shared Function FromHandle( _
   ByVal handle As IntPtr _
) As IWin32Window
C# 
public static IWin32Window FromHandle( 
   IntPtr handle
)

Parameters

handle

Example

Library/Library.Test/TestWin32Window.cs

C#Copy Code
IntPtr ptr = new IntPtr(0x01000);//any number but zero

Assert.IsNotNull(Win32Window.FromHandle(ptr));
Assert.AreEqual(ptr, Win32Window.FromHandle(ptr).Handle);
VB.NETCopy Code
Dim ptr As New IntPtr(&H1000)
'any number but zero
Assert.IsNotNull(Win32Window.FromHandle(ptr))
Assert.AreEqual(ptr, Win32Window.FromHandle(ptr).Handle)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys