The additional power absorbed by the plasma can be determined from the time derivative of the total plasma energy, which can be estimated from the diamagnetic flux of the plasma using a diamagnetic loop. The main difficulty in using diamagnetic measurements to estimate the kinetic energy is the compensation of the flux measurement sensitivity to poloidal magnetic fields, which is not always easy to adjust. A method based on the temporal variations of the diamagnetic flux of the plasma during modulated electron cyclotron heating (MECH) has been developed. Using MECH has the advantage that these poloidal fields are not significantly modulated and a good compensation of these fields is not necessary. However, a good compensation of the vessel poloidal image current is crucial to ensure a sufficiently large bandwidth. The application of this diagnostic to studies of the extraordinary mode (X-mode) absorption at the third electron cyclotron harmonic frequency (X3) has been performed on the TCV tokamak in plasmas pre-heated by the X-mode at the second harmonic (X2). A MECH frequency scan has allowed the determination of an optimum modulation frequency, situated at about 200-250 Hz. Based on this diagnostic, full single-pass absorption of the injected X3 power was measured with the X2 pre-heating in co-current drive. This high absorption is more than a factor of 2 higher than that predicted by the linear ray tracing code TORAY. Experimental evidence indicates that a large fraction of the X3 power is absorbed by electrons in an energetic tail created by the X2 pre-heating.