The phase separation kinetics of a two-dimensional binary mixture at critical composition confined between (one-dimensional) straight walls which preferentially attract one component of the mixture is studied for a wide range of distances D between the walls. Following earlier related work on semiinfinite systems, two choices of surface forces at the walls are considered, one corresponding to an incompletely wet state of the walls, the other to a completely wet state (for D --> infinity). The nonlinear Cahn-Hilliard-type equation, supplemented with appropriate boundary conditions which account for the presence of surfaces, is replaced by a discrete equivalent and integrated numerically. Starting from a random initial distribution of the two species (say, A and B), an oscillatory concentration profile rapidly forms across the film. This is characterized by two thin enrichment layers of the preferred component at the walls, followed by adjacent depletion layers. While in these layers phase separation is essentially complete, the further oscillations of the average composition at distance Z from a wall get rapidly damped as Z increases toward the center of the film. This structure is relatively stable for an intermediate time scale, while the inhomogeneous structure in the center of the film coarsens. The concentration correlation function in directions parallel to the walls (integrated over all Z) and the associated structure factor (describing small-angle scattering from the film) exhibit a scaling behavior, similar to bulk spinodal decomposition, and the characteristic length scale grows with time as l(p)arallel to(t) = alpha + beta t(a), where a is close to the Lifshitz-Slyozov value 1/3, and the coefficients alpha, beta depend on film thickness only weakly. Only when one considers the local correlation function at distances close to the walls are deviations from scaling observed due to the competing effects of the growing surface enrichment layers. However, at very late times [when [l(p)arallel to(t) becomes comparable to D] this bulklike description breaks down, and a concentration distribution is expected to be established which is a superposition of domains separated by interfaces perpendicular to the walls, the one type of domain being rich in A and nearly homogeneous, and the other poor in A except for two thin enrichment layers at the walls.