protected override void Dispose(bool disposing) { // call the base class to let it disconnect the window proc. HWND hwnd = Hwnd; base.Dispose(disposing); NativeMethods.DestroyWindow(hwnd); _strongHwnd.OnHandleReleased(); }