Skip to main content
GameDev.net gamedev.net
🔒 Locked

[WINAPI] Taking screenshots of windows

Started by Jedive Sep 10, 2005 at 12:04 PM 5 replies 1.6k views
Original Post
Jedive
Jedive
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?
Shannon Barber
Shannon Barber
It has to be, hitting print-screen does exactly that.


google'd msdn print-screen screenshot

Found this link
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
barrysee
barrysee

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.
Arek the Absolute
Arek the Absolute
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.
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Sijmen
Sijmen
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.
Jedive
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.
Sijmen
Sijmen
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



Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.