{ ****************************************************************** }
{                                                                    }
{   TWindowImage is a Delphi/Windows screen image capture component. }
{   While it can always be used in the same manner as it's parent,   }
{   TImage, it's primary use is for capturing screen/window images.  }
{   TWindowImage is primarily used in screen capture applications.   }
{                                                                    }
{   TWindowImage, as it descends from TImage, has all the events,    }
{   properties, and methods of TImage.  In addition, the component   }
{   has the following additional event, method, and properties:      }
{                                                                    }
{        Event:    OnCapture, occurs when a screen/window image has  }
{                  been captured, as a result of a GetWindowImage    }
{                  method call.  Add code for this event via the     }
{                  Events page of the Object Inspector, to add any   }
{                  special code to be executed on image captures.    }
{                  Add code for this event at design-time, to be     }
{		   executed when the event occurs at run-time.       }
{                                                                    }
{        Method:   GetWindowImage, acquires a bitmap image of the    }
{		   desired screen, window, or window client area, as }
{                  selected by setting the properties below.         }
{                  Callable/executable at run-time only.             }
{                  (Example call/usage: WindowImage1.GetWindowImage;)}
{                                                                    }
{        Property: WActiveWindow (boolean), Window/Screen selection  }
{                  TRUE  = Select active window only                 }
{                  FALSE = Select entire display screen              }
{                  Selectable at either Design-Time or Run-Time.     }
{                  (Example: WindowImage1.WActiveWindow:=TRUE;)      }
{                                                                    }
{        Property: WClientArea (boolean), Window area selection      }
{                  TRUE  = Select client area of window only         }
{                  FALSE = Select entire window (with borders, etc.) }
{                  Selectable at either Design-Time or Run-Time.     }
{                  (Example: WindowImage1.WClientArea:=TRUE;)        }
{                  (Note: full-screen client area = full-screen)     }
{                                                                    }
{        Property: OtherWindow (hwnd), specifies the handle to some  }
{                  other window/control to capture a bitmap of.      }
{                  Selectable only at Run-Time.                      }
{                  (Example: windowwanted:=findwindow(nil,           }
{                                                'Program Manager'); }
{                            WindowImage1.OtherWindow:=windowwanted;)}
{                  (Note: using OtherWindow overrides WActiveWindow, }
{		          set to 0, zero, to reset during execution) }
{                                                                    }
{ ****************************************************************** }


To use the TWindowImage component:
----------------------------------
 0. Start Delphi, if needed.
 1. Install the TWindowImage component, if needed.
    (See file install.txt, for installation procedures)
 2. From the component palette, add a TWindowImage component
    to a form.  The palette hint for the TWindowImage component
    will say: WindowImage.
 3. Do whatever design-time property settings required, for the
    inherited properties from TImage (position, size, stretch, etc.).
 4. Do whatever design-time property settings required, for the
    additional properties of TWindowImage (set the properties to
    indicate the screen/window/client screen area to capture when
    GetWindowImage method calls are performed: WActiveWindow,
    WClientArea).
 5. Add code, at design-time, to the event handling procedures, for
    events of interest during your application's execution (OnClick,
    OnDblClick, OnCapture, etc.).  Note that the OnCapture event is
    provided to perform any special processing that is desired on
    window/screen image captures.  This is probably where you want to
    add code to save images to files, if needed.
 6. Add code to your application to set run-time only properties
    or modify/override the properties that were set at design-time.
    These property changes take place at application-execution time.
    At execution time, you may want to select some other window in
    the system to capture a bitmap image of (via OtherWindow), change
    the window area selection values, change size/position, etc.
 7. Add code to your application to execute the GetWindowImage method
    to capture the screen/window image specified by the selection of
    the properties referenced above.  GetWindowImage will fire the
    OnCapture event when the image has been captured and the control
    invalidated.
 8. Add whatever other code to your application, as needed.
 9. Save the application files, compile, link, run, etc., as needed.


Run-Time Code Examples (code snippets):
---------------------------------------
1. Capture monitor/display full-screen image:

   windowimage1.WActiveWindow:=false;
   windowimage1.WClientArea:=false;
   windowimage1.OtherWindow:=0;
   windowimage1.GetWindowImage;

2. Capture image of active window screen:

   windowimage1.WActiveWindow:=true;
   windowimage1.WClientArea:=false;
   windowimage1.OtherWindow:=0;
   windowimage1.GetWindowImage;

3. Capture image of active window client area:

   windowimage1.WActiveWindow:=true;
   windowimage1.WClientArea:=true;
   windowimage1.OtherWindow:=0;
   windowimage1.GetWindowImage;

4. Capture image of Program Manager window:

   windowimage1.WActiveWindow:=false;
   windowimage1.WClientArea:=false;
   windowimage1.OtherWindow:=findwindow(nil,'Program Manager');
   windowimage1.GetWindowImage;

5. Capture image of a button on a form:

   windowimage1.WActiveWindow:=false;
   windowimage1.WClientArea:=false;
   windowimage1.OtherWindow:=button1.handle;
   windowimage1.GetWindowImage;

6. Capture image of client area of some other visible window/control:

   windowimage1.WActiveWindow:=false;
   windowimage1.WClientArea:=true;
   windowimage1.OtherWindow:=some_other_windows_handle;
   windowimage1.GetWindowImage;

(Note: examples 1 through 6 could each save the captured image to a file
       by placing a line like this in the OnCapture event handler for the
       TWindowImage component: WindowImage1.picture.savetofile(filename);)


Please study/run the demo programs for further, more extended, examples
of TWindowImage component usage.  The demos provide more complex
scenarios that are probably a bit more similar to real-world needs.
The demo programs are contained in the file demos.zip.