private LRESULT screen2windowCoordinates( HWND hwnd, LPARAM lParam ) {
			// get window rectangle needed to convert mouse x/y from screen to window coordinates
			RECT rcWindow = new RECT();
			User32.INSTANCE.GetWindowRect( hwnd, rcWindow );

			// get mouse x/y in window coordinates
			int x = GET_X_LPARAM( lParam ) - rcWindow.left;
			int y = GET_Y_LPARAM( lParam ) - rcWindow.top;

			return new LRESULT( MAKELONG( x, y ) );
		}
Converts screen coordinates to window coordinates.
flatlaf-natives/flatlaf-natives-jna/src/main/java/com/formdev/flatlaf/natives/jna/windows/FlatWindowsNativeWindowBorder.java