I believe melatonin is unrelated to this question, it’s a hormone that helps you sleep, and windows should have nothing to do with the absoption of melatonin.
I think you mean melanin, which is a pigment in the skin that protects it from the sun, making it dark. It is not absorbed, but created in response to genetics and sun exposure.
To answer your question, you can be effected by light from a window, because light is still passing through it- you can still see,because of this. So theoretically you could get sunburnt or tan from sitting by a window.