Locking device for a door, a window or similar having a frame that can be fixedly mounted, having at least one leaf supported in the frame, wherein it is provided that - the locking device has a lock housing having an upper locking bar connecting device that is moveably supported in the lock housing and an upper locking bar attached thereto guided in or on the leaf and having a lower locking bar connecting device that is moveably supported in the lock housing and a lower locking bar attached thereto guided in or on the leaf, wherein the upper locking bar connecting device and the lower locking bar connecting device are movement-coupled, preferably simultaneously movement-coupled in the opposite direction, - the locking device has an actuation device, via which the upper locking bar connecting device and the lower locking bar connecting device can be actuated for locking and/or unlocking, wherein it is provided that - the upper and the lower locking bars are coupled to each other via a coupling transmission of the actuation device of the locking device, - an auxiliary latch interacts with the upper locking bar and the lower locking bar in such a way that the locking bars are retracted in the open position of the door, - a switch device is switched between the auxiliary latch and at least one of the locking bars, said switch device interacting with the auxiliary latch in such a way that the switch device is released by the auxiliary latch when the leaf is retracting into the closing position, and the released switch device detaches stopping members which block the locking bar in the retracted position, characterised in that - the locking device has an upper locking end allocated to the upper locking bar and a lower locking end allocated to the lower locking bar, wherein the upper locking end is formed to be moveable relative to the upper locking bar in the extension direction of the upper locking bar, - the locking device is formed in such a way that the upper bolt bar connecting device and the lower locking bar connecting device simultaneously extend in the opposite direction for locking, but the lower locking end only extends when the upper locking end is at least partially extended, - wherein the lower locking bar can only extend as soon as the stopping members no longer engage in the latching groove of the control bar and thus have released the control bar, and - wherein the stopping members are shifted by a control curve of the switch device, such that the switch device can fully extend when the upper locking end is extended. - the locking device has a lock housing having an upper locking bar connecting device that is moveably supported in the lock housing and an upper locking bar attached thereto guided in or on the leaf and having a lower locking bar connecting device that is moveably supported in the lock housing and a lower locking bar attached thereto guided in or on the leaf, wherein the upper locking bar connecting device and the lower locking bar connecting device are movement-coupled, preferably simultaneously movement-coupled in the opposite direction, - the locking device has an actuation device, via which the upper locking bar connecting device and the lower locking bar connecting device can be actuated for locking and/or unlocking, wherein it is provided that - the upper and the lower locking bars are coupled to each other via a coupling transmission of the actuation device of the locking device, - an auxiliary latch interacts with the upper locking bar and the lower locking bar in such a way that the locking bars are retracted in the open position of the door, - a switch device is switched between the auxiliary latch and at least one of the locking bars, said switch device interacting with the auxiliary latch in such a way that the switch device is released by the auxiliary latch when the leaf is retracting into the closing position, and the released switch device detaches stopping members which block the locking bar in the retracted position, characterised in that - the locking device has an upper locking end allocated to the upper locking bar and a lower locking end allocated to the lower locking bar, wherein the upper locking end is formed to be moveable relative to the upper locking bar in the extension direction of the upper locking bar, - the locking device is formed in such a way that the upper bolt bar connecting device and the lower locking bar connecting device simultaneously extend in the opposite direction for locking, but the lower locking end only extends when the upper locking end is at least partially extended, - wherein the lower locking bar can only extend as soon as the stopping members no longer engage in the latching groove of the control bar and thus have released the control bar, and - wherein the stopping members are shifted by a control curve of the switch device, such that the switch device can fully extend when the upper locking end is extended.