I am developing an application in C# and want to know how to get the screen shot image of any window when we only know its window handle. The functionality I am trying to achieve is to be able to just copy the screen shot of any window (it can be a whole application or a control inside an application) when I only know its window handle.
Example: I am running a calculator application, and Spy++. When I use find window functionality of the Spy++ and hover my mouse over different buttons of the calculator, it show different window handles. Lets say I hover mouse over "9" button in the calculator. Now as I know its window handle, I want to get image of the "9" button only. If I have window handle of the complete application then I want to be able to get the screen shot of that application only. Similar to Alt+PrintScr.