In this paper, we first propose an extended Casimir method for energy-shaping. Then it is used to solve some control problems of Hamiltonian systems. To solve the H∞ control problem, the energy function of a Hamiltonian system is shaped to such a form that could be a candidate solution of HJI inequality. Next, the energy function is shaped as a candidate of control ISS-Lyapunov function, and then the input-to-state stabilization of port-controlled Hamiltonian systems is achieved. Some easily verifiable sufficient conditions are presented.