Density and chain conformation profiles of square-well chains between two parallel walls were studied by using density-functional theory. The free energy of square-well chains is separated into two contributions: the hard-sphere repulsion and the attraction. The Heaviside function is used as the weighting function for both of the two parts. The equation of state of Hu et al. is used to calculate the excess free energy of the repulsive part. The equation of state of statistical associating fluid theory for chain molecules with attractive potentials of variable range [A. Gil-Villegas et al. J. Chem. Phys. 106, 4168 (1997)] is used to calculate the excess free energy of the attractive part. Because the wall is inaccessible to a mass center of a longer chain, there exists a sharp fall in the distribution of end-to-end distance near the wall as the chain length increases. When the average density of the system is not too low, the prediction of this work is in good agreement with computer simulation results for the density profiles and the chain conformation over a wide range of chain length, temperature, and attraction strength of the walls. However, when the average density and the temperature are very low, the prediction deviates to a certain degree from the computer simulation results for molecules with long chain length. A more accurate functional approximation is needed.