Digital and analog window optimization problems are often characterized by a few number of variables with many constraints. In some cases the optimization problem becomes semi-infinite, i.e. a finite number of variables with an infinite set of constraints. This paper presents a method for flattop window design and enhancement using the Dual Nested Complex Approximation (DNCA) algorithm. Flattop windows can be used for accurate amplitude measurements in spectral analysis and can also be used to design FIR filters with very high stopband attenuation. This paper proposes using the DNCA scheme to solve the optimization problem, due to its low computational complexity and memory consumption. It can be run on any desktop computer. The framework of the DNCA scheme is presented together with two examples; one concerning the design of an enhanced version of the ISO 18431-2 flattop window and the other concerns the design of a flattop window which is comparable with the commercial P-401.