A closure for a window, a door or the like, wherein the window, the door or the like has a frame and a leaf movable with respect to the frame and the closure is configured for a releasable fixing of the leaf to the frame in the assembled state, wherein the closure comprises: a base body configured for fastening to the frame or to the leaf; and a plurality of components (14, 19, 21, 26) movable with respect to the base body, wherein a plurality of functional states of the closure are defined by different positions of the movable components (14, 19, 21, 26); a sensor arrangement which is configured to monitor the different positions of the movable components (14, 19, 21, 26) and to output respective position signals; and an electronic evaluation device which is configured to receive the position signals and, on the basis of a comparison of the position signals with respective default values, to generate a status signal which indicates the instantaneous functional state of the closure, wherein the movable components (14, 19, 21, 26) comprise: a closure element which defines a holding receiver for a latch element fastened to the leaf or to the frame and which is movable between a release position releasing the latch element in an opening direction of the leaf and a blocking position blocking the latch element in the opening direction, characterized in that, when the closure is installed, the closure element can be automatically moved from the release position in the direction of the blocking position by a closing movement of the leaf, and a blocking element which can be moved between a locking position and an unlocking position, wherein, in the locking position, the blocking element prevents a movement of the closure element from the blocking position into the release position and, in the unlocking position, the blocking element permits a movement of the closure element between the blocking position and the release position, wherein the closure comprises a motor for driving the blocking element, and a control device for controlling the motor, and wherein the control device is configured to set the blocking element into the locking position on a movement of the closure element into the blocking position and to move the blocking element in the direction of the unlocking position again after a predefined period of time has elapsed. a base body configured for fastening to the frame or to the leaf; and a plurality of components (14, 19, 21, 26) movable with respect to the base body, wherein a plurality of functional states of the closure are defined by different positions of the movable components (14, 19, 21, 26); a sensor arrangement which is configured to monitor the different positions of the movable components (14, 19, 21, 26) and to output respective position signals; and an electronic evaluation device which is configured to receive the position signals and, on the basis of a comparison of the position signals with respective default values, to generate a status signal which indicates the instantaneous functional state of the closure, a closure element which defines a holding receiver for a latch element fastened to the leaf or to the frame and which is movable between a release position releasing the latch element in an opening direction of the leaf and a blocking position blocking the latch element in the opening direction, characterized in that, when the closure is installed, the closure element can be automatically moved from the release position in the direction of the blocking position by a closing movement of the leaf, and a blocking element which can be moved between a locking position and an unlocking position, wherein, in the locking position, the blocking element prevents a movement of the closure element from the blocking position into the release position and, in the unlocking position, the blocking element permits a movement of the closure element between the blocking position and the release position, wherein the closure comprises a motor for driving the blocking element, and a control device for controlling the motor, and wherein the control device is configured to set the blocking element into the locking position on a movement of the closure element into the blocking position and to move the blocking element in the direction of the unlocking position again after a predefined period of time has elapsed.