Density functional theory for inhomogeneous polymer systems. II. Application to block copolymer thin films