Why use windowing function instead of truncating the signal to integer amount of periods?
When an integer number of periods is known, truncation when followed by FFT (assuming periodicity) is equivalent to windowing it with a uniform window. Using another window may induce some leakage.

But, if your signal was sampled this way, this either means that you were very lucky, or that you already have a lot of knowledge about your signal. And thus that you have dmaller need for Fourier analysis.

The point of using specific windows is indeed to help analysis when periods are unknown.