As Jocko says clean out and lube the channels the glass runs in to reduce friction caused by dryness / dirt , there are no 'up' and 'down' limit switches on the the window, but control monitors the current the motor is drawing and if that current exceeds a certain limit the window will stop. The same current overload causes the window to stop when it hits the fully up or down physical stops.
The reason conventional 'jack of all trades' WD40 is a bad thing is that it it dries sticky and attracts dirt. IIRC WD makers bought out 3 in 1 lubricant makers and now specialised lubricants like Silicone and PTFE are sold under 'WD' name and these are OK for window channels. Conventional WD ( water dispersant' ) was intended to displace any water on surface of metals and replace it with a sticky waterproof film to prevent corrosion - it is not a lubricant.