The existence and stability ol periodic solutions for the two-dimensional system x'=f(x)+εg(x,a),0<ε<<1,a∈R whose unperturbed systemis Hamiltonian can be decided by using the signs of Melnikov's function.The results can be applied to the construction of phase portraits in the bifurcation set of codimension two bifurcations of flows with doublezero eigenvalues.