IWin32Window 介面
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供來公開 Win32 HWND 控制代碼的介面。
public interface class IWin32Window
C#
[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
C#
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
- 衍生
- 屬性
下列範例會將 Text 的 屬性 label1
設定為 的 Form1
目前 Handle 。 此範例假設您有一個 Form 名為 的 Label , Form1
其上已呼叫 label1
。
public:
Form1()
{
InitializeComponent();
this->label1->Text = this->Handle.ToString();
}
C#
public Form1()
{
InitializeComponent();
this.label1.Text = this.Handle.ToString();
}
Public Sub New()
InitializeComponent()
Me.label1.Text = Me.Handle.ToString()
End Sub
這個介面會在公開 Win32 HWND 控制碼的物件上實作。 結果控制碼可以搭配 Windows API 呼叫使用。
Handle |
取得以實作器表示的視窗控制代碼。 |
產品 | 版本 |
---|---|
.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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |