Several years ago, I wrote an article on how to capture a window into a bitmap using WM_PRINT message, even when the window does not handle WM_PRINT message or it's hidden from desktop.
To me, the interesting part is hook BeginPaint and EndPaint to use the HDC passed to WM_PRINT using a few lines of assembly code. You can call it 偷梁换柱.
It seems that the article is quite popular. You can find several links on the web. I received two more emails last week asking me how to use the code to capture window created by another process. One guy even offered $200/hr to make it work for his special case.
I added a modified sample code in which the capturing code is put into a DLL and then injected into target process for window capturing. Link to the new sample code can be found at the end of the article at: http://www.fengyuan.com/article/wmprint.html.
If you want to learn something about assembly code, read it and step through the code.