Freigeben über


HwndWrapper Class

Represents a disposable wrapper around an HWND that can construct the WNDCLASS and HWND, run the WndProc and dispose of the WNDCLASS and HWND.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.PlatformUI.DisposableObject
    Microsoft.VisualStudio.PlatformUI.HwndWrapper

Namespace:  Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public MustInherit Class HwndWrapper _
    Inherits DisposableObject
public abstract class HwndWrapper : DisposableObject
public ref class HwndWrapper abstract : public DisposableObject
[<AbstractClass>]
type HwndWrapper =  
    class 
        inherit DisposableObject 
    end
public abstract class HwndWrapper extends DisposableObject

The HwndWrapper type exposes the following members.

Constructors

  Name Description
Protected method HwndWrapper Creates a new instance of the class.

Top

Properties

  Name Description
Public property Handle
Public property IsDisposed Returns whether the object has been disposed once, which protects against double disposal. (Inherited from DisposableObject.)
Protected property IsWindowSubclassed
Protected property WindowClassAtom Gets or creates the class atom returned from CreateWindowClassCore.

Top

Methods

  Name Description
Protected method CreateWindowClassCore Creates the WNDCLASS atom to use for constructing this window’s handle.
Protected method CreateWindowCore Creates the handle for the window.
Protected method DestroyWindowClassCore Destroys the WNDCLASS atom created with CreateWindowClassCore.
Protected method DestroyWindowCore Destroys the window handle created by CreateWindowCore.
Public method Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from DisposableObject.)
Protected method Dispose(Boolean) Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Standard virtual overload for IDisposable pattern. (Inherited from DisposableObject.)
Protected method DisposeManagedResources Allows derived classes to provide custom dispose handling for managed resources. (Inherited from DisposableObject.)
Protected method DisposeNativeResources Calls DestroyWindowCore and DestroyWindowClassCore. (Overrides DisposableObject.DisposeNativeResources().)
Public method EnsureHandle Ensures that the handle for this window is created (creating the handle if it doesn't already exist). Note that EnsureHandle faisl to create the window's handle if it's called while in the process of creating the handle. In this case, the Handle is left uncreated for the current call.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from DisposableObject.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method RegisterClass Registers a window class with the given name, and with other options set to default values.
Protected method ThrowIfDisposed Throws an ObjectDisposedException if this object has been disposed. (Inherited from DisposableObject.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method WndProc Runs the WndProc for this window.

Top

Events

  Name Description
Public event Disposing Raised when the event is being disposed, that is, while it is still accessible. (Inherited from DisposableObject.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.PlatformUI Namespace