IWin32Window 介面

定義

提供來公開 Win32 HWND 控制代碼的介面。

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
衍生
屬性

範例

下列範例會將 Text 的 屬性 label1 設定為 的 Form1 目前 Handle 。 此範例假設您有一個 Form 名為 的 LabelForm1 其上已呼叫 label1

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

備註

這個介面會在公開 Win32 HWND 控制碼的物件上實作。 結果控制碼可以搭配 Windows API 呼叫使用。

屬性

Handle

取得以實作器表示的視窗控制代碼。

適用於