Lock for a moveably, preferably pivotably, mounted leaf of a door or a window, having a lock mechanism which is attachable on the leaf side, having a locking device (6, 7) and an actuation device (8, 8d), wherein it is provided that - the locking device (6, 7) has an upper locking bar (7, 17) and/or a lower locking bar, i.e. at least one locking bar, which can be actuated by the actuation device (8, 8d), - the locking device (6, 7) has a preferably spring-loaded mounted latch which has an inlet bevel and/or an outlet bevel and is formed such that the latch can be brought into engagement in a striking plate attached on the frame side by forming a locking position and brought out of engagement of the striking plate by forming an unlocking position, - the at least one locking bar (7, 17) and the latch are formed moveably relative to each other, and the at least one locking bar (7, 17) cooperates directly or indirectly with the latch to control the latch, - in the region of the latch, the locking device has an auxiliary latch device having an auxiliary latch, which can be controlled via the striking plate or a part on the striking plate side and cooperates with the locking bar (7, 17) to block or release the locking bar (7, 17), wherein the at least one locking bar (7, 17) cooperates with the latch and the auxiliary latch in such a way that a) with an actuated auxiliary latch and non-actuated latch, the locking bar (7, 17) is blocked and is not released, and b) with an actuated auxiliary latch and simultaneously actuated latch, the locking bar (7, 17) is blocked and is not released, and c) with an actuated auxiliary latch and simultaneously actuated latch, the blocking of the locking bar (7, 17) is removed and thus the locking bar is released by a subsequent removal of the actuation of the latch, with continuing actuation of the auxiliary latch, wherein a switching element is arranged interposed between the auxiliary latch and the locking bar (7, 17), and wherein the switching element cooperates with at least one stopping element which is switched between the auxiliary latch and the switching element, and the locking bar (7, 17) cooperates with at least one catch element which can be controlled by the switching element in such a way that the catch element blocks the locking bar (7, 17) in a catch position and releases the locking bar in a non-catch position. - the locking device (6, 7) has an upper locking bar (7, 17) and/or a lower locking bar, i.e. at least one locking bar, which can be actuated by the actuation device (8, 8d), - the locking device (6, 7) has a preferably spring-loaded mounted latch which has an inlet bevel and/or an outlet bevel and is formed such that the latch can be brought into engagement in a striking plate attached on the frame side by forming a locking position and brought out of engagement of the striking plate by forming an unlocking position, - the at least one locking bar (7, 17) and the latch are formed moveably relative to each other, and the at least one locking bar (7, 17) cooperates directly or indirectly with the latch to control the latch, - in the region of the latch, the locking device has an auxiliary latch device having an auxiliary latch, which can be controlled via the striking plate or a part on the striking plate side and cooperates with the locking bar (7, 17) to block or release the locking bar (7, 17), wherein the at least one locking bar (7, 17) cooperates with the latch and the auxiliary latch in such a way that a) with an actuated auxiliary latch and non-actuated latch, the locking bar (7, 17) is blocked and is not released, and b) with an actuated auxiliary latch and simultaneously actuated latch, the locking bar (7, 17) is blocked and is not released, and c) with an actuated auxiliary latch and simultaneously actuated latch, the blocking of the locking bar (7, 17) is removed and thus the locking bar is released by a subsequent removal of the actuation of the latch, with continuing actuation of the auxiliary latch, wherein a switching element is arranged interposed between the auxiliary latch and the locking bar (7, 17), and wherein the switching element cooperates with at least one stopping element which is switched between the auxiliary latch and the switching element, and the locking bar (7, 17) cooperates with at least one catch element which can be controlled by the switching element in such a way that the catch element blocks the locking bar (7, 17) in a catch position and releases the locking bar in a non-catch position. a) with an actuated auxiliary latch and non-actuated latch, the locking bar (7, 17) is blocked and is not released, and b) with an actuated auxiliary latch and simultaneously actuated latch, the locking bar (7, 17) is blocked and is not released, and c) with an actuated auxiliary latch and simultaneously actuated latch, the blocking of the locking bar (7, 17) is removed and thus the locking bar is released by a subsequent removal of the actuation of the latch, with continuing actuation of the auxiliary latch, wherein a switching element is arranged interposed between the auxiliary latch and the locking bar (7, 17), and wherein the switching element cooperates with at least one stopping element which is switched between the auxiliary latch and the switching element, and the locking bar (7, 17) cooperates with at least one catch element which can be controlled by the switching element in such a way that the catch element blocks the locking bar (7, 17) in a catch position and releases the locking bar in a non-catch position.