Sign in to follow this  
RanmaruX

Capture the screen before I show my window? :)

Recommended Posts

RanmaruX    122
Ok I'm using C++ with DirectX (so therefore it's a win32 app). What I'd like to do is capture the screen when the user runs my program (but before I show my window). Is this easily done and if so, can anyone suggest how? I'm just thinking of cool things to do at the start of the program :p

Share this post


Link to post
Share on other sites
Aardvajk    13207
I vaguely remember (someone please correct me) that if you call GetDC() but pass 0 as the HWND parameter, you get a DC of the current desktop which you could then copy to a bitmap or whatever using the GDI.

I suppose this would work if you called it before your ShowWindow() call in WinMain.

Sorry to be so vague.

Share this post


Link to post
Share on other sites
e-u-l-o-g-y    196
I guess you could use GetDesktopWindow and GetWindowDC... it's a bit long since last i used win32 api :P

EDIT:
After reading it again, I'm not quite sure this is what you want. What did you really mean? Are you going to capture the whole desktop, or the frame you're currently rendering? At first I thought you were going to do something like this:

http://www.vbaccelerator.com/home/VB/Code/Libraries/Graphics_and_GDI/Changing_Window_Shapes/Creating_Window_Shapes_from_Bitmaps/article.asp

[Edited by - e-u-l-o-g-y on March 17, 2006 11:25:48 AM]

Share this post


Link to post
Share on other sites
RanmaruX    122
Anyone ever play Terminal City on the c64? ;)

I was thinking of having it so the first screen the player sees when they run the program is an image of their desktop (or whatever was on screen when they ran the program) and then maybe having it shrink into nothing or doing some other kind of transition between that and the loading / intro screen.

I'm sure you'd notice some flicker or some obvious difference when it switches between the real desktop and the program's 'fake' desktop but it would be interesting to try it :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this