System.Windows.Forms.XplatUICarbon.DestroyWindow C# (CSharp) Method

DestroyWindow() private method

private DestroyWindow ( IntPtr handle ) : void
handle System.IntPtr
return void
		internal override void DestroyWindow(IntPtr handle) {
			Hwnd	hwnd;

			hwnd = Hwnd.ObjectFromHandle(handle);

			if (hwnd == null) {
				return;
			}

			SendParentNotify (hwnd.Handle, Msg.WM_DESTROY, int.MaxValue, int.MaxValue);
				
			CleanupCachedWindows (hwnd);

			ArrayList windows = new ArrayList ();

			AccumulateDestroyedHandles (Control.ControlNativeWindow.ControlFromHandle(hwnd.Handle), windows);


			foreach (Hwnd h in windows) {
				SendMessage (h.Handle, Msg.WM_DESTROY, IntPtr.Zero, IntPtr.Zero);
				h.zombie = true;
			}

			// TODO: This is crashing swf-messageboxes
			/*
			if (false && hwnd.whole_window != IntPtr.Zero)
				CFRelease (hwnd.whole_window);
			if (false && hwnd.client_window != IntPtr.Zero)
				CFRelease (hwnd.client_window);
			*/

			if (WindowMapping [hwnd.Handle] != null) { 
				DisposeWindow ((IntPtr)(WindowMapping [hwnd.Handle]));
				WindowMapping.Remove (hwnd.Handle);
			}
		}
XplatUICarbon