A locking assembly, for windows and doors having a sash arranged to be openable with respect to a main frame, the locking assembly comprising: a strike plate designed to be mounted on the main frame, having at least one stationary locking member (21, 22); and a latching device designed to be mounted on the sash so as to be located opposite the strike plate when the sash is in a closed position, comprising a casing and at least one latching hook (11, 12) secured to a pinion (13, 14) which is rotatable inside the casing, further comprising an actuation slider (4; 5) having at least one rack portion (41, 42) engaged with said pinion (13, 14) so that a motion of said actuation slider entails said pinion to rotate, said actuation slider being guided in the casing to slide between a locking position in which said at least one latching hook (11, 12) is in locking engagement with a corresponding stationary locking member (21, 22) to lock the sash in the closed position and an unlocking position in which said at least one latching hook is disengaged from said stationary locking member to allow opening of the sash, characterised in that the locking assembly further comprises a security device adapted to retain said actuation slider (4; 5) in its unlocking position as long as the sash is in an open position, said security device comprising a retention pawl (30; 31) mounted moveable on the latching device and further comprising an unlocking member provided on the strike plate, said retention pawl (30; 31) being able to occupy a retention position in which it engages a retention part (45; 55) of said actuation slider to retain said actuation slider in its unlocking position and further being able to be displaced from said retention position by said unlocking member so that it disengages from said retention part (45; 55) when the sash arrives in the closed position. a strike plate designed to be mounted on the main frame, having at least one stationary locking member (21, 22); and a latching device designed to be mounted on the sash so as to be located opposite the strike plate when the sash is in a closed position, comprising a casing and at least one latching hook (11, 12) secured to a pinion (13, 14) which is rotatable inside the casing, further comprising an actuation slider (4; 5) having at least one rack portion (41, 42) engaged with said pinion (13, 14) so that a motion of said actuation slider entails said pinion to rotate, said actuation slider being guided in the casing to slide between a locking position in which said at least one latching hook (11, 12) is in locking engagement with a corresponding stationary locking member (21, 22) to lock the sash in the closed position and an unlocking position in which said at least one latching hook is disengaged from said stationary locking member to allow opening of the sash, characterised in that the locking assembly further comprises a security device adapted to retain said actuation slider (4; 5) in its unlocking position as long as the sash is in an open position, said security device comprising a retention pawl (30; 31) mounted moveable on the latching device and further comprising an unlocking member provided on the strike plate, said retention pawl (30; 31) being able to occupy a retention position in which it engages a retention part (45; 55) of said actuation slider to retain said actuation slider in its unlocking position and further being able to be displaced from said retention position by said unlocking member so that it disengages from said retention part (45; 55) when the sash arrives in the closed position.