public bool Destroy() { if (User32Methods.DestroyWindow(this.Handle)) { this.Handle = IntPtr.Zero; return(true); } return(false); }
public static void DestroyAllWindows(string className) { IntPtr windowPtr; do { windowPtr = User32Methods.FindWindow(className, null); User32Methods.DestroyWindow(windowPtr); } while (windowPtr != IntPtr.Zero); }
protected virtual void Dispose(bool disposing) { if (this.IsDisposed) { return; } if (this.IsSourceOwner) { User32Methods.DestroyWindow(this.Handle); } else { ((INativeConnectable)this).Detach(); } this.IsDisposed = true; GC.SuppressFinalize(this); }