Archived

This topic is now archived and is closed to further replies.

Taking Screenshots?

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Screenshots of your window or the entire screen?

For screen, use HDC hDC = GetDC(NULL).
For client area, use HDC hDC = GetDC(hWnd);
For the entire window, use HDC hDC = GetWindowDC(hWnd);

Then, read the bitmap as described here. Remember to release DC when you''re done.

Share this post


Link to post
Share on other sites
Yeah, there is. You need to call GetDesktopWindow to obtain the handle of the desktop, and call GetDC to get the device context. Then create a memory DC by calling CreateCompatibleDC. You will also need to create a compatible bitmap, by calling CreateCompatibleBitmap and SelectObject it into the memory DC. BitBlt the desktop DC to the memory DC, and that will put the screenshot into the memory DC.

Hope this helps!

Share this post


Link to post
Share on other sites