/// <summary> /// Destroys the window with the given handle and class atom and unregisters its window class /// </summary> /// <param name="args">A DestrowWindowParams instance</param> internal static object DestroyWindow(object args) { SecurityCriticalDataClass <IntPtr> handle = ((DestroyWindowArgs)args).Handle; ushort classAtom = ((DestroyWindowArgs)args).ClassAtom; Invariant.Assert(handle != null && handle.Value != IntPtr.Zero, "Attempting to destroy an invalid hwnd"); UnsafeNativeMethods.DestroyWindow(new HandleRef(null, handle.Value)); UnregisterClass((object)classAtom); return(null); }