We consider a quantum waveguide described by a pair of three-dimensional plane-parallel layers with common boundary containing a window joining the layers. As the window expands, the threshold of the essential spectrum generates bound states, anti-bound states, or resonances. We propose an original efficient algorithm for constructing complete asymptotic expansions for the associated spectral parameters and nontrivial solutions. Using a nontrivial technique, we justify the constructed asymptotic expansions and analyze their structure. Bibliography: 36 titles. Illustrations: 1 figure.