i've a window, on WM_PAINT i wanna paint what is behing that window, i know how i paint. But i don't know how i get the handle of the window that is behing (GetDesktopWindow() ?) soo next i get is DC and paint. Since behing my window could be various windows its like to do a screen capture with my window hidden and then show it up and paint. Any ideas?

tnkx in advance...
Jean
Posted on 2002-06-09 22:56:55 by coder
Do you mean that you want your window's background to be the output of other windows?

Set the window class's hBkBrush to NULL. This means that by default, BeginPaint will not clear your window's client area using any brush.


Or do you wish to write into another window's client area??
Posted on 2002-06-10 00:08:48 by AmkG
you could try determining the window below yours with GetNextWindow.
Posted on 2002-06-10 00:15:12 by smurf
I don't have my PSDK right now. I think there is a code somewhere in PSDK - I'm not sure but check out the BitBlt function, there's probably a screen capture code there that hides your proggy and captures the whole entire screen.

To hide your window: invoke ShowWindow, hWnd, SW_HIDE
Posted on 2002-06-10 00:33:59 by stryker
1. ShowWindow(hWnd, SW_HIDE)
2. GetForegroundWindow to retrieve the handle of the window beneath


smurf, I think GetNextWindow doesn't necessarily return the handle of the window behind yours. Instead it returns the window which was created after yours.
Posted on 2002-06-10 05:27:49 by C.Z.

Do you mean that you want your window's background to be the output of other windows?

Set the window class's hBkBrush to NULL. This means that by default, BeginPaint will not clear your window's client area using any brush.

its +/- this. But if the other windows change they output, i've to update mine window too. Lets say that my window is WS_EX_TOPMOST and on every paint it needs to get what is behind it. That works but only if the other windows keep unchanged.


Its like to make a screen capture but i don't wanna hide my window and i don't wanna include it screen capture ;)
Posted on 2002-06-10 12:55:56 by coder
Just butting in here,

What about WS_EX_TRANSPARENT?? Just draw what you need to draw on WM_PAINT, and everything that isn't drawn will be the background. And if a window is updated underneath, your program doesn't have to even think worry about it. A lot of MP3 players do this (Sonique, Windows media Player). Of course, if you want to have a "regular" looking window you'll probably have to handle drawing the frame and caption yourself.

--Chorus
Posted on 2002-06-10 13:30:19 by chorus