Does anybody know how to get a screenshot of the whole window screen and then save it in a file as .bmp or .gif ... image?

When I get the handle to the desktop window and then copy all the pixels on my window, what will it copy...just the wallpaper or what?