lately i found a really great trick to stop unwanted thoughts or worries, and I have MANY, perhaps you can find it useful: whenever I think for instance of someone that makes me suffer (I find that it works better if it is a person) I visualize immediately that person run over by a really fast train, or tons of bricks falling over him, or a huge cartoon-like bomb that blows his to pieces and all the bits flying away, or in front of a machine gun, or inside the Titanic going down really fast, you get the picture. After a lifetime of suffering for years for things that other people would overcome in a week, I find this trick really useful, and no, I wouldn't use a machine gun in real life.
I guess you can use a similar trick for happy memories, they are even worse, for them probably it's more useful to feel grateful, because some people never experienced them? If you feel grateful, you put them in the past where they belong, you might wish and feel pain because you want them back, but if you concentrate on the joy you DID experience and remember it fully, it should hurt less, just a guess.
Also knowing a reason (or making a reason) to explain why the happiness had to stop helps, maybe to concentrate on that is better at first than to concentrate on the past happiness.