Condividi tramite


IWin32Window Interfaccia

Definizione

Fornisce un'interfaccia per esporre handle HWND Win32.

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
Derivato
Attributi

Esempio

Nell'esempio seguente la Text proprietà di label1 viene impostata sull'oggetto corrente Handle di Form1. In questo esempio si presuppone che sia presente un Form oggetto denominato Form1 con una Label chiamata 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

Commenti

Questa interfaccia viene implementata su oggetti che espongono handle HWND Win32. L'handle risultante può essere usato con le chiamate API di Windows.

Proprietà

Nome Descrizione
Handle

Ottiene l'handle per la finestra rappresentata dall'implementatore.

Si applica a