IWin32Window 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供一个用于公开 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 IWin32Windowpublic 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 = interfacetype IWin32Window = interfacePublic Interface IWin32Window- 派生
- 属性
示例
以下示例将 Text 属性 label1 设置为当前 Handle 值 Form1。 本示例假定你已 Form Form1 Label 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 | 获取由实施者表示的窗口句柄。 |