A method of controlling operation of a motorised driving device of a sliding window for a building, the window comprising at least: - a frame, and - a sash (3a, 3b), 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, and - an electronic control unit, the electronic control unit comprising at least: - a device for measuring a value of an intensity of an electric current flowing through the electric motor, the method comprising at least the following steps: - controlling the electric motor by means of a supply voltage (Vbus), so as to move the sash with respect to the frame, and - during the movement of the sash with respect to the frame, measuring values of the intensity of the electric current flowing through the electric motor by the measuring device, characterised in that the method comprises at least the following steps: - during the movement of the sash with respect to the frame, determining the presence or absence of a hard point, as a function of a change in the values of the intensity of the electric current measured, during the measuring step, and - following the determination of a hard point, during the determining step, modifying the command of the electric motor by limiting the supply voltage (Vbus), so as to maintain a rotational speed of an output shaft of the electric motor below a maximum speed threshold value (Vmax), and in that the hard point is determined, during the determining step, when the change of the values of the intensity of the electric current measured, during the measuring step, has a peak and then a fall in the values of the intensity of the electric current. the window comprising at least: - a frame, and - a sash (3a, 3b), - a frame, and - a sash (3a, 3b), 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, and - an electronic control unit, - an electromechanical actuator, the electromechanical actuator comprising at least one electric motor, and - an electronic control unit, the electronic control unit comprising at least: - a device for measuring a value of an intensity of an electric current flowing through the electric motor, - a device for measuring a value of an intensity of an electric current flowing through the electric motor, the method comprising at least the following steps: - controlling the electric motor by means of a supply voltage (Vbus), so as to move the sash with respect to the frame, and - during the movement of the sash with respect to the frame, measuring values of the intensity of the electric current flowing through the electric motor by the measuring device, - controlling the electric motor by means of a supply voltage (Vbus), so as to move the sash with respect to the frame, and - during the movement of the sash with respect to the frame, measuring values of the intensity of the electric current flowing through the electric motor by the measuring device, characterised in that the method comprises at least the following steps: - during the movement of the sash with respect to the frame, determining the presence or absence of a hard point, as a function of a change in the values of the intensity of the electric current measured, during the measuring step, and - following the determination of a hard point, during the determining step, modifying the command of the electric motor by limiting the supply voltage (Vbus), so as to maintain a rotational speed of an output shaft of the electric motor below a maximum speed threshold value (Vmax), - during the movement of the sash with respect to the frame, determining the presence or absence of a hard point, as a function of a change in the values of the intensity of the electric current measured, during the measuring step, and - following the determination of a hard point, during the determining step, modifying the command of the electric motor by limiting the supply voltage (Vbus), so as to maintain a rotational speed of an output shaft of the electric motor below a maximum speed threshold value (Vmax), and in that the hard point is determined, during the determining step, when the change of the values of the intensity of the electric current measured, during the measuring step, has a peak and then a fall in the values of the intensity of the electric current.