WINCAP3
~~~~~~~

 Written by James Brown 2005
 www.catch22.net

Howto capture the contents of a Hidden Window.

Requires Windows XP. Will NOT work under 95/98/ME. Might work
under NT/2000 but untested.

HOW TO USE
~~~~~~~~~~

Use the supplied wincap demo program:

 wincap <hwnd> <output.bmp> [bitdepth]

i.e.

 wincap 00127B pic1.bmp 24		- captures 24bit bitmap
 wincap 00127B pic2.bmp			- captures using current display settings

If you want to do the capture from your own program, then load the
capture.dll module, get the CaptureWindow exported function, and call
this directly from your own code:

   HBITMAP WINAPI CaptureWindow(HWND hwnd, nBitDepth)

The CaptureWindow API does all the necessary DLL injection and
now returns a handle to a "DIB-SECTION".

You must delete this bitmap-handle using another CAPTURE.DLL exported function:
  
  BOOL WINAPI DeleteDibSection(HBITMAP hBitmap);

You can save the dib-section to disk using:

  BOOL WINAPI SaveDibSection(HBITMAP hBitmap, TCHAR *szFileName);


HOW IT WORKS
~~~~~~~~~~~~

WinCap is based on the work by Feng Yuan. It injects a DLL into 
whatever process owns the specified window. The DLL hooks the 
BeginPaint and EndPaint APIs in the remote process. It then sends
a WM_PAINT in the hope that the window will call BeginPaint/EndPaint
when it processes this message. 

The hook for Begin/EndPaint modifies the return value of these 
functions and causes the application to paint into a private off-screen DC 
instead of a regular screen DC. 

In addition to WM_PAINT, the WM_NCPAINT and WM_ERASEBKGND are simulated
to provide the complete window painting cycle. 

To capture an entire window (and it's children), WinCap has to enumerate
all child windows and repeatedly capture each one, copying each bitmap
into one big bitmap, ready to be copied to the clipboard.

TODO
~~~~

* Still has problems with some Windows i.e. Internet Explorer.
* Look at the PrintWindow API in XP+
* Emulate WS_CLIPCHILDREN and WS_CLIPSIBLING effects
* Minimized windows don't work yet