I have now found the fourth and final(?) sensor! It's in the door lock.
So, the window system first of all checks the sensor I found near to the airbag to see if it's the contact position (window fully closed) or open (window open).
If this sensor is detecting the window is fully closed, when you start to open either the inside or outside door handle the system will dip the windo until this sensor is in the open position. When you shut the door, the sensor in the door lock detects the engagement of the door latch and fires a signal to raise the glass untill the sensor by the airbag closes thereby letting the system know the window is fully shut.
If the sensor near the air bag detects the window is already open (because the contacts of the misroswitch are also open) the window dip doesnot operate.
Likewise, when you raise the window using the button on the dash, the system detects when the glass is fully up when the micro switch by the airbag closes.
So: Microswitches in both door handles to detect door opening, microswitch near the airbag to regulate the window position and micro switch in the door lock to detect door closed (this also seems to operate the cabin lights too).
Mine is a 2002 car, so possibly different to later ones, but I have seen pictures of a later car with the same bit of black tape covering the hole where the sensor by the air bag is situated.
Simples.
-David-