IWin32Window IWin32Window IWin32Window IWin32Window Interface

定义

提供一个界面,用于公开 Win32 HWND 句柄。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
type IWin32Window = interface
Public Interface IWin32Window
派生
属性

示例

下面的示例设置Text的属性label1与当前HandleForm1The following example sets the Text property of label1 to the current Handle of Form1. 此示例假定你拥有Form称为Form1Label调用label1上它。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    

注解

在公开 Win32 HWND 句柄的对象上实现此接口。This interface is implemented on objects that expose Win32 HWND handles. 可与 Windows API 调用生成的句柄。The resultant handle can be used with Windows API calls.

属性

Handle Handle Handle Handle

获取由实施者表示的窗口句柄。Gets the handle to the window represented by the implementer.

适用于