Partager via


IWin32Window Interface

Définition

Fournit une interface permettant d’exposer des handles 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
Dérivé
Attributs

Exemples

L’exemple suivant définit la Text propriété de label1 la valeur actuelle Handle de Form1. Cet exemple part du principe que vous avez un Form appel avec un Label appelé Form1label1.

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

Remarques

Cette interface est implémentée sur les objets qui exposent des handles HWND Win32. Le handle résultant peut être utilisé avec les appels d’API Windows.

Propriétés

Nom Description
Handle

Obtient le handle dans la fenêtre représentée par l’implémenteur.

S’applique à