How to apply Hamming Window?
The window length should be equal to your transform length, not necessarily the length of your entire data set.  The two are the same, of course, if you are going to transform the entire data set at once, but if you are planning to do shorter transforms then you should make the window length equal to the length of those transforms.