How to capture the current Window without the background

When I always capture a screen shot, I just pressed the Print Screen button, then open photo editing software and cut the background after that use the pic, but yesterday my friend tought me a new trick, just press Alt + Print Screen button on the required window, you will get the screen shot for the current window without the background