LRESULT WmEraseBkgnd( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
			if( background == null )
				return new LRESULT( 0 );

			// fill background
			HDC hdc = new HDC( wParam.toPointer() );
		    RECT rect = new RECT();
		    User32.INSTANCE.GetClientRect( hwnd, rect );
		    User32Ex.INSTANCE.FillRect( hdc, rect, background );
		    return new LRESULT( 1 );
		}
Handle WM_ERASEBKGND

https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-erasebkgnd
flatlaf-natives/flatlaf-natives-jna/src/main/java/com/formdev/flatlaf/natives/jna/windows/FlatWindowsNativeWindowBorder.java