From what i have seen and searched through these forums, (and google) I have not really seen many tips on what to look for when buying a used (previously enjoyed) firearm. Although i am eyeballing a couple in the marketplace, what is it we should look for? Being new to this, I don't know if there's way to tell if there is defects or abuse (I guess paint marks..etc) but still, I'm always a little concerned when buying something used. Now mainly I'm talking about handguns here, but long guns I'm sure can be put in here as well.

a few questions from the top of my head:

1) Is it possible a barrel could be bent/cracked/weathered etc? How can i tell?
2) Unless at a range, is it possible to check the action/cycle of a firearm? (semi auto?..etc)
3) Is there any way to tell approximately how many rounds might be through it?
4) Is it possible to replace a barrel on a handgun if needed? Do you have to re-register it?

I wouldn't want to make a purchase, take it to the range, and it gets destroyed in my hand or something...

Any buying tips or things to look out for to help us newbies, is very much appreciated. I'm sure there's many more ways to look at this that i can't even think of. And yes, i personally do not currently own a firearm yet, and have not had much experience around them as of this posting, but today am submitting my memberships to clubs.