private int onNcHitTest( int x, int y, boolean isOnResizeBorder ) {
			// scale-down mouse x/y because Swing coordinates/values may be scaled on a HiDPI screen
			Point pt = scaleDown( x, y );

			// return HTSYSMENU if mouse is over application icon
			//   - left-click on HTSYSMENU area shows system menu
			//   - double-left-click sends WM_CLOSE
			if( contains( appIconBounds, pt ) )
				return HTSYSMENU;

			// return HTMINBUTTON if mouse is over minimize button
			//   - hovering mouse over HTMINBUTTON area shows tooltip on Windows 10/11
			if( contains( minimizeButtonBounds, pt ) )
				return HTMINBUTTON;

			// return HTMAXBUTTON if mouse is over maximize/restore button
			//   - hovering mouse over HTMAXBUTTON area shows tooltip on Windows 10
			//   - hovering mouse over HTMAXBUTTON area shows snap layouts menu on Windows 11
			//     https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu
			if( contains( maximizeButtonBounds, pt ) )
				return HTMAXBUTTON;

			// return HTCLOSE if mouse is over close button
			//   - hovering mouse over HTCLOSE area shows tooltip on Windows 10/11
			if( contains( closeButtonBounds, pt ) )
				return HTCLOSE;

			// return HTTOP if mouse is over top resize border
			//   - hovering mouse shows vertical resize cursor
			//   - left-click and drag vertically resizes window
			if( isOnResizeBorder )
				return HTTOP;

			boolean isOnTitleBar = (pt.y < titleBarHeight);
			if( isOnTitleBar ) {
				// return HTCLIENT if mouse is over any Swing component in title bar
				// that processes mouse events (e.g. buttons, menus, etc)
				//   - Windows ignores mouse events in this area
				try {
					if( captionHitTestCallback != null && !captionHitTestCallback.test( pt ) )
						return HTCLIENT;
				} catch( Throwable ex ) {
					// ignore
				}

				// return HTCAPTION if mouse is over title bar
				//   - right-click shows system menu
				//   - double-left-click maximizes/restores window size
				return HTCAPTION;
			}

			// return HTCLIENT
			//   - Windows ignores mouse events in this area
			return HTCLIENT;
		}
Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages,
slightly delay event firing and fire it only once (on the AWT thread).
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatWindowsNativeWindowBorder.java