  We successively apply the generalized Case-Foldy-Feshbach-Villars (CFFV) and
the Foldy-Wouthuysen (FW) transformation to derive the Hamiltonian for
relativistic scalar particles in an electromagnetic field. In contrast to the
original transformation, the generalized CFFV transformation contains an
arbitrary parameter and can be performed for massless particles, which allows
solving the problem of massless particles in an electromagnetic field. We show
that the form of the Hamiltonian in the FW representation is independent of the
arbitrarily chosen parameter. Compared with the classical Hamiltonian for point
particles, this Hamiltonian contains quantum terms characterizing the
quadrupole coupling of moving particles to the electric field and the electric
and mixed polarizabilities. We obtain the quantum mechanical and semiclassical
equations of motion of massive and massless particles in an electromagnetic
field.
