Content. Electron-cyclotron maser emission (ECME) is the favored mechanism for solar radio spikes and has been investigated extensively since the 1980s. Most studies relevant to solar spikes employ a loss-cone-type distribution of energetic electrons, generating waves mainly in the fundamental X/O mode (X1/O1), with a ratio of plasma oscillation frequency to electron gyrofrequency (${omega}_ {pe}/{Omega}_{ce}$) lower than 1. Despite the great progress made in this theory, one major problem is how the fundamental emissions pass through the second-harmonic absorption layer in the corona and escape. This is generally known as the escaping difficulty of the theory. Aims. We study the harmonic emissions generated by ECME driven by energetic electrons with the horseshoe distribution to solve the escaping difficulty of ECME for solar spikes. Methods. We performed a fully kinetic electromagnetic PIC simulation with ${omega}_ {pe}/{Omega}_{ce}$ = 0.1, corresponding to the strongly magnetized plasma conditions in the flare region, with energetic electrons characterized by the horseshoe distribution. We also varied the density ratio of energetic electrons to total electrons ($n_e/n_0$) in the simulation. Results. We obtain efficient amplification of waves in Z and X2 modes, with a relatively weak growth of O1 and X3. With a higher-density ratio, the X2 emission becomes more intense, and the rate of energy conversion from energetic electrons into X2 modes can reach $sim$0.06% and 0.17%, with $n_e/n_0$= 5% and 10%, respectively. Conclusions. We find that the horseshoe-driven ECME can lead to an efficient excitation of X2 and X3 with a low value of ${omega}_ {pe}/{Omega}_{ce}$, providing novel means for resolving the escaping difficulty of ECME when applied to solar radio spikes. The simultaneous growth of X2 and X3 can be used to explain some harmonic structures observed in solar spikes.