Jump to content
  • Advertisement
Sign in to follow this  
Jedive

[WINAPI] Taking screenshots of windows

This topic is 4811 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

In a program I am making, I need to take screenshots of the opened windows in the desktop... is that possible using the Windows API?

Share this post


Link to post
Share on other sites
Advertisement

HDC screen = CreateDC("DISPLAY", NULL, NULL, NULL);

and blit that onto a dc where you've made a bitmap the size of the screen and then write that to a file.

Share this post


Link to post
Share on other sites
I know you can use GetDesktopWindow to get a handle to a window that represents the current screen... That is, your desktop, all the visible windows and so on. I imagine you could use that function along with the window rect of the window you're interested in to get a screenshot, although there may be more efficient methods as well.

Share this post


Link to post
Share on other sites
I think the TS wants to have images of all individual windows, maybe to do something like OS X Exposé or something similar. I don't know the answer myself, but wanted to mention just this.

Share this post


Link to post
Share on other sites
Thanks all for your answers, will try by doing what you said.

Yes Sijmen, that's exactly what I want to do, layout all my Windows in an Exposé style.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jedive
Thanks all for your answers, will try by doing what you said.

Yes Sijmen, that's exactly what I want to do, layout all my Windows in an Exposé style.


Heh, guessed that. However, you know there is already an Exposé like tool for Windows available? Google for Expose + Windows.

Good luck!

--Sijmen



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!