Partilhar via


HwndWrapper Class

Definition

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

public ref class HwndWrapper abstract : Microsoft::VisualStudio::PlatformUI::DisposableObject
[Windows::Foundation::Metadata::WebHostHidden]
public ref class HwndWrapper abstract : Microsoft::VisualStudio::PlatformUI::DisposableObject
[Windows::Foundation::Metadata::WebHostHidden]
class HwndWrapper abstract : Microsoft::VisualStudio::PlatformUI::DisposableObject
public abstract class HwndWrapper : Microsoft.VisualStudio.PlatformUI.DisposableObject
type HwndWrapper = class
    inherit DisposableObject
Public MustInherit Class HwndWrapper
Inherits DisposableObject
Inheritance
HwndWrapper

Constructors

HwndWrapper()

Creates a new instance of the class.

Properties

Handle

Gets or creates the handle for the window.

IsDisposed

Returns whether the object has been disposed once, protects against double disposal

(Inherited from DisposableObject)
IsWindowSubclassed

Determines whether or not a per-instance window procedure should be created for each HWND. By default, HwndWrapper uses the window class's default window procedure for the HWND.

WindowClassAtom

Gets or creates the class atom returned from CreateWindowClassCore.

Methods

CreateWindowClassCore()

Creates the WNDCLASS atom to use for constructing this window's handle.

CreateWindowCore()

Creates the handle for the window.

DestroyWindowClassCore()

Destroys the WNDCLASS atom created with CreateWindowClassCore.

DestroyWindowCore()

Destroys the window handle created by CreateWindowCore.

Dispose()

Disposes the current object then suppresses further finalization.

(Inherited from DisposableObject)
Dispose(Boolean)

Standard virtual overload for IDisposable pattern

(Inherited from DisposableObject)
DisposeManagedResources()

Allows derived classes to provide custom dispose handling for managed resources

(Inherited from DisposableObject)
DisposeNativeResources()

Calls DestroyWindowCore() and DestroyWindowClassCore().

EnsureHandle()

Ensures that the handle for this window is created (creating the handle if it doesn't already exist).

Note that EnsureHandle will fail to create the window's handle if creation is not allowed. In this case, the Handle is left uncreated for the current call.

RegisterClass(String)

Registers a Window class with the given name, and other options set to default values.

ThrowIfDisposed()

Throws an ObjectDisposedException if this object has been disposed

(Inherited from DisposableObject)
WndProc(IntPtr, Int32, IntPtr, IntPtr)

Runs the WndProc for this window.

Events

Disposing

Raised when the event is being disposed, while it is still accessible.

(Inherited from DisposableObject)

Applies to