A method of controlling operation of a motorised driving device of a sliding window for a building, the window comprising at least: - a frame, - a sash (3a, 3b), and - a first locking device of the sash with respect to the frame in a locked ajar position, the locked ajar position being arranged between an open position and a closed position of the sash with respect to the frame, the motorised driving device being configured to move the sash with respect to the frame, the motorised driving device comprising at least: - an electromechanical actuator, the electromechanical actuator comprising at least one electric motor, - an electronic control unit, and - a counting device, the counting device being configured to cooperate with the electronic control unit, the counting device and the electronic control unit being configured to determine a position of the sash with respect to the frame, characterised in that the method comprises at least the following steps: - first movement of the sash with respect to the frame from an open position to the locked ajar position, implemented manually, without electrically activating the electric motor of the electromechanical actuator, - determination of the manual movement and of the reaching of the locked ajar position of the sash with respect to the frame, during the first movement step, by means of the counting device, and - following the determination of the manual movement and the reaching of the locked ajar position of the sash with respect to the frame, during the determination step, automatic starting of the electric motor of the electromechanical actuator by means of the electronic control unit, so as to unlock the first locking device by moving the sash with respect to the frame, implemented by the electrical activation of the electric motor of the electromechanical actuator. the window comprising at least: - a frame, - a sash (3a, 3b), and - a first locking device of the sash with respect to the frame in a locked ajar position, the locked ajar position being arranged between an open position and a closed position of the sash with respect to the frame, the motorised driving device being configured to move the sash with respect to the frame, - a frame, - a sash (3a, 3b), and - a first locking device of the sash with respect to the frame in a locked ajar position, the locked ajar position being arranged between an open position and a closed position of the sash with respect to the frame, the motorised driving device being configured to move the sash with respect to the frame, the motorised driving device comprising at least: - an electromechanical actuator, the electromechanical actuator comprising at least one electric motor, - an electronic control unit, and - a counting device, the counting device being configured to cooperate with the electronic control unit, the counting device and the electronic control unit being configured to determine a position of the sash with respect to the frame, - an electromechanical actuator, the electromechanical actuator comprising at least one electric motor, - an electronic control unit, and - a counting device, the counting device being configured to cooperate with the electronic control unit, the counting device and the electronic control unit being configured to determine a position of the sash with respect to the frame, characterised in that the method comprises at least the following steps: - first movement of the sash with respect to the frame from an open position to the locked ajar position, implemented manually, without electrically activating the electric motor of the electromechanical actuator, - determination of the manual movement and of the reaching of the locked ajar position of the sash with respect to the frame, during the first movement step, by means of the counting device, and - following the determination of the manual movement and the reaching of the locked ajar position of the sash with respect to the frame, during the determination step, automatic starting of the electric motor of the electromechanical actuator by means of the electronic control unit, so as to unlock the first locking device by moving the sash with respect to the frame, implemented by the electrical activation of the electric motor of the electromechanical actuator. - first movement of the sash with respect to the frame from an open position to the locked ajar position, implemented manually, without electrically activating the electric motor of the electromechanical actuator, - determination of the manual movement and of the reaching of the locked ajar position of the sash with respect to the frame, during the first movement step, by means of the counting device, and - following the determination of the manual movement and the reaching of the locked ajar position of the sash with respect to the frame, during the determination step, automatic starting of the electric motor of the electromechanical actuator by means of the electronic control unit, so as to unlock the first locking device by moving the sash with respect to the frame, implemented by the electrical activation of the electric motor of the electromechanical actuator.