Improve the non-popup search window generation routine