Probably the simplest circuit to measure such a distance is a string pot. You wrap a string around the shaft of a multi turn potentiometer (possibly with a small cylinder attached to the shaft to take a longer length per turn, so the 10 turns has just a bit more length capability than you need) and apply a fixed voltage across the full resistance. Then the voltage from one end of the resistance to the wiper represents distance. You also need a spring or weight tensioning arrangement or double winding (one end of the string unwinds and the other winds up as the window slides) to keep the string tight. Digitizing the voltage and "capturing" that is another problem.
If you use an A/D converter, you are talking about 12*64=768 points or about a 10 bit converter.