I have read that it's UVB rays that produce vitamin D and they won't travel through a glass window. It's also doubtful whether you'd get enough if it was cloudy, even if you were outside. Oily fish gives you some, but I take a D supplement during the Winter.