I agree with mj about the coffee can and the stick. Try to find an appropriate replacement behavior and when he is banging on the door or the keyboard, simply redirect him to the 'appropriate' objects and let him have at it.
I have some questions regarding his loss of appetite. You say that he used to be a good eater, was his diet varied? or did he eat a large amount of a few foods. if this is the case, he could have become sick of them. that's called a 'food jag' when you eat the same things every day and you eventually reach the point where you simply can't stand them any more. lots of people do this. the problem with kids who have a limited diet in the first place is that they don't decide 'well, i'm sick of mac and cheese now, why don't i try a peanut butter and jelly sandwich?' They simply eliminate the mac and cheese from their diet with no replacement. This may not be the case at all with your son. Regardless, a little more information regarding his eating habits will be helpful:
1. Will he eat new and unfamiliar foods on his own?
2. Does he feed himself?
3. Does he tell you when he is hungry and what he wants to eat?
4. Does he have highly preferred or favorite foods?
5. Anything else significant about his eating habits?
What if you gave him a stick and an old coffee can? He can be your little drummer boy. A future Ringo Starr? Seriously, maybe he just likes to bang on things. Give him a harmless creative outlet.
As for the appetite, I dunno.