private void updateFrame( int state ) {
			// Following SetWindowPos() sends a WM_SIZE(SIZE_RESTORED) message to the window
			// (although SWP_NOSIZE is set), which would prevent maximizing/minimizing
			// when making the frame visible.
			// AWT uses WM_SIZE wParam SIZE_RESTORED to update JFrame.extendedState and
			// removes MAXIMIZED_BOTH and ICONIFIED. (see method AwtFrame::WmSize() in awt_Frame.cpp)
			// To avoid this, change WM_SIZE wParam to SIZE_MAXIMIZED or SIZE_MINIMIZED if necessary.
			if( (state & JFrame.ICONIFIED) != 0 )
				wmSizeWParam = SIZE_MINIMIZED;
			else if( (state & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH )
				wmSizeWParam = SIZE_MAXIMIZED;
			else
				wmSizeWParam = -1;

			// this sends WM_NCCALCSIZE and removes/shows the window title bar
			User32.INSTANCE.SetWindowPos( hwnd, hwnd, 0, 0, 0, 0,
				SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );

			wmSizeWParam = -1;
		}
Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages,
slightly delay event firing and fire it only once (on the AWT thread).
flatlaf-natives/flatlaf-natives-jna/src/main/java/com/formdev/flatlaf/natives/jna/windows/FlatWindowsNativeWindowBorder.java