A closure for a window, for 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, wherein the closure comprises: a base body configured for fastening to the frame or to the leaf; and a closure element which is supported at the base body , which defines a holding mount 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 (R) of the leaf and a blocked position blocking the latch element in the opening direction; wherein, when the closure is assembled, the closure element is automatically movable from the release position in the direction of the blocked position by a closing movement of the leaf and is latchable to the base body in at least one fixed position, which is located between the release position and the blocked position and which already blocks the latch element in the opening direction (R), such that a movement of the closure element in the direction of the release position is prevented and a movement of the closure element in the direction of the blocked position is, in contrast, made possible; and wherein the closure comprises a motor which is arranged at the base body and which is provided to directly or indirectly act on the closure element located in the fixed position on an activation such that said closure element moves into the blocked position, characterized in that the base body is configured for fastening in a fitting groove of the frame or of the leaf; in that the motor is designed as an electric motor, with an electric energy store for the energy supply of the electric motor being arranged at the base body ; and in that the base body has a housing section which at least partly surrounds the motor and/or the electric energy store . a base body configured for fastening to the frame or to the leaf; and a closure element which is supported at the base body , which defines a holding mount 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 (R) of the leaf and a blocked position blocking the latch element in the opening direction; wherein, when the closure is assembled, the closure element is automatically movable from the release position in the direction of the blocked position by a closing movement of the leaf and is latchable to the base body in at least one fixed position, which is located between the release position and the blocked position and which already blocks the latch element in the opening direction (R), such that a movement of the closure element in the direction of the release position is prevented and a movement of the closure element in the direction of the blocked position is, in contrast, made possible; and wherein the closure comprises a motor which is arranged at the base body and which is provided to directly or indirectly act on the closure element located in the fixed position on an activation such that said closure element moves into the blocked position, characterized in that the base body is configured for fastening in a fitting groove of the frame or of the leaf; in that the motor is designed as an electric motor, with an electric energy store for the energy supply of the electric motor being arranged at the base body ; and in that the base body has a housing section which at least partly surrounds the motor and/or the electric energy store . <EOS>