Screen capture of non visible windows

S

Sambucus

Hi all!.

I'm trying to capture a screen shot of a window. This works good until
the window is partly or completley hidden, then i get the graphics of
what is visible on my screen (the windows that cover my screen shot
window). I have tried this in both MCF and pure win32 but with the
same result.

I know i can set the window i want to capture to the front/top with
commands such as SetForegroundWindow() and SetWindowPos(). The
problem is however that i don't want the window to be placed on top of
other windows.

Is this even possible? I not is there any other way to get the Bitmap
or color of pixels out of hidden windows?

Any help much appreciated!
 
R

Rob Williscroft

Sambucus wrote in
Any help much appreciated!

Post your question in a news group where windows/MFC programmers
hang out:

news://comp.os.ms-windows.programmer.win32
news://comp.os.ms-windows.programmer.tools.mfc

HTH.

Rob.
 
S

Stewart Gordon

While it was 2/23/04 2:20 PM throughout the UK, Sambucus sprinkled
little black dots on a white screen, and they fell thus:
Hi all!.

I'm trying to capture a screen shot of a window.

Standard C++ knows nothing of windows.
This works good until the window is partly or completley hidden, then
i get the graphics of what is visible on my screen (the windows that
cover my screen shot window). I have tried this in both MCF and pure
win32 but with the same result.

Windows, in general, keeps no record of obscured window content. This
is why, when you write a Windows program, you have to tell it how to redraw.

Stewart.
 
J

John Carson

Stewart Gordon said:
Windows, in general, keeps no record of obscured window content. This
is why, when you write a Windows program, you have to tell it how to
redraw.

True, but this doesn't necessarily stop you from getting a screen capture of
non-visible windows. You can ask a window to draw itself into a memory
device context.
 
S

Sambucus

Rob Williscroft said:
Sambucus wrote in

Post your question in a news group where windows/MFC programmers
hang out:

news://comp.os.ms-windows.programmer.win32
news://comp.os.ms-windows.programmer.tools.mfc
I have done that to.
 
S

Sambucus

Stewart Gordon said:
While it was 2/23/04 2:20 PM throughout the UK, Sambucus sprinkled
little black dots on a white screen, and they fell thus:

Standard C++ knows nothing of windows.


Windows, in general, keeps no record of obscured window content. This
is why, when you write a Windows program, you have to tell it how to redraw.
Ok, then it was as i suspected. Back to my question, is there any way
to get the graphics or pixels (pixel color at certain X,Y is what I am
after) in a hidden window by any means, get it from memory or using
any type of system hook?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top