That may be more complex than you think, depending on the make, model, and year of the car.Basically, the steps you need to follow will be something like this.
- Determine the method the circuit uses to detect the fuly CLOSED and OPEN conditions
- Decide whether or not you can use that same method to signal your program, or design your own.
- Decide whether or not you can detect the amount of movement of the windiw, or if you need to use time.
- Decide how you want to run the motor (directly, or by closing a circuit that bypasses the switch).
- Design a circuit that will safely run the motor.
- Write the Arduino code to do whatever you want with the circuit.
Depending on your level of knowledge of electronics, you might want to ask questions on a couple of other forums:
** General Electronics**
** Motors, Mechanics, and Power**
Once you get the first 5 steps figured out, Programming Questions is the place to ask about code.
Sounds like an interesting project.