Snapshot the screen

I have an hwnd that I do not control its OnPaint. I want to get create a bmp file that capture the window bitmap pixels. How can i do it?????
Who is Participating?
there is a good example on how to capture the whole screen in MSDN under the "Capturing an Image" title - search for it.
It can easily be modified to capture a specific window, not the whole screen
tchalkov, the given example does not provide any possibility to save image as bmp...
In the same topic two titles bellow there is one called "Storing an image". It describes storing a bitmap.

BTW the whole topic is a good reading to start with.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.