IWin32Window Interface
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides an interface to expose Win32 HWND handles.
public interface class IWin32Window
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.Guid("458AB8A2-A1EA-4d7b-8EBE-DEE5D3D9442C")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IWin32Window
public interface IWin32Window
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Runtime.InteropServices.Guid("458AB8A2-A1EA-4d7b-8EBE-DEE5D3D9442C")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IWin32Window = interface
type IWin32Window = interface
Public Interface IWin32Window
- Derived
- Attributes
The following example sets the Text property of label1
to the current Handle of Form1
. This example assumes that you have a Form called Form1
with a Label called label1
on it.
public:
Form1()
{
InitializeComponent();
this->label1->Text = this->Handle.ToString();
}
public Form1()
{
InitializeComponent();
this.label1.Text = this.Handle.ToString();
}
Public Sub New()
InitializeComponent()
Me.label1.Text = Me.Handle.ToString()
End Sub
This interface is implemented on objects that expose Win32 HWND handles. The resultant handle can be used with Windows API calls.
Handle |
Gets the handle to the window represented by the implementer. |
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: