How can i capture a window(with scrollbars) whole client area and draw it into another window?
Posted on 2002-09-25 08:51:40 by mihai
i never done this but i think you could just pass the windows handle of your choice
to the GetDC API function... this API should give you the handle of the window's
device context which you can use to copy from (via the bitblt function). you can
retrieve the windows handle via the FindWindow function for example. then just
copy the dc portion of your destination window to a dc maintained by YOUR window.
Posted on 2002-09-25 10:08:55 by mob
The first problem is :
if the window from i want to capture the bitmap is covered by another window the bitmap obtined with bitblt contain a part (or hole) of the window that are in front

the result bitmap does not contain the invisible client area (the window contains scrollbars and I want the hole client area)

In the attachment you will find a test.
Posted on 2002-09-26 03:00:53 by mihai
the "windows-viewer" just crashes on w2k...

so GetDC is wrong but GetWindowsDC should work fine according to this...

The GetWindowDC function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.

but i really doubt that you can capture hidden or disguised windows.
Posted on 2002-09-26 04:41:01 by mob