unit Wordcap;
{**********************************************************************}
{** WordCap  - provides a gradient filled caption bar, with Italic   **}
{**            text, in the style of MSOffice for Win95.             **}
{** ---------------------------------------------------------------- **}
{** Author   - Warren F. Young.                                      **}
{**            Portions of code were taken from Brad D. Stowers.     **}
{**            Brad acknowledged assistance from Michiel Ouwehand of **}
{**            Epic MegaGames.                                       **}
{** e-mail   - wfy@ee.ed.ac.uk,   or   WMYoung@compuserve.com        **}
{** WWW      - http://www.ee.ed.ac.uk/~wfy/components.html           **}
{** ---------------------------------------------------------------- **}
{** Suggested Usage                                                  **}
{**          - For a 32-bit installation you need the files          **}
{**            wordcap.pas and wordcap.dcr.                          **}
{**          - For a 16-bit installation you need the files          **}
{**            wordcap.pas and wrdcap16.dcr (renamed to Wordcap.dcr).**}
{**          - Install the component "WordCap.pas" into Delphi.      **}
{**          - Place the component on your form. (MSOfficeCaption)   **}  
{**          - Set the parameters in the object inspector            **}
{**          - You have a shaded caption bar - LIVE AT DESIGN TIME!! **}
{** ---------------------------------------------------------------- **}
{** History  - Version 1.00  (23/July/1996). Initial release (WWW).  **}
{**          - Version 1.01  (06/August/1996). Fixed a system        **}
{**              resources bug caused by (bmp.left > bmp.right).     **}
{**          - Version 1.02  (09/August/1996).                       **}
{**          - Version 1.03  (15/August/1996).                       **}
{**              with 32bit calls from 16bit apps (if available).    **}
{**          - Version 1.04  (15/August/1996).                       **}
{**              with fixed up AutoHeight routine.                   **}
{**          - Version 1.05  (20/August/1996).                       **}
{**              with AppNameText property.                          **}
{**          - Version 1.06  (30/August/1996).                       **}
{**              with improved AUTO option for Position property.    **}
{**          - Version 1.10  (1/October/1996).                       **}
{**              re-Released on WWW.  First official release.        **}
{**              Sent to Delphi SuperPage and Torry's Delphi Pages.  **}
{**          - Version 1.11  (6/November/1996).                      **}
{**              Fixed problem with large borders on windows.        **}
{**          - Version 1.2   (17/December/1996).                     **}
{**              Fixed problem flickering (in 32bit version only).   **}
{**          - Version 1.21  (19/December/1996).                     **}
{**              Fixed drawing problems (in 32bit version only)      **}
{**              when using geWhenActive, and changing the caption.  **}
{**          - Version 1.22  (22/December/1996).                     **}
{**              Fixed drawing problems in WinNT 4.x.  Fixed some    **}
{**              but not all MDI child drawing problems.             **}
{**          - Version 1.23  (24/December/1996)                      **}
{**              Fixed more MDI drawing problems, and offered a      **}
{**              band-aid for another.                               **}
{**          - Version 1.24  (26/December/1996)                      **}
{**              Corrected another MDI drawing problem, and tidied   **}
{**              up the code a bit.                                  **}
{**          - Version 1.25  (28/December/1996)                      **}
{**              Removed flicker on NCActivate Message.  Removed     **}
{**              autoupdating (after property changes) at run-time.  **}
{**          - Version 1.26  (02/January/1997)                       **}
{**              Improved the icon painting routine for the 32 bit   **}
{**              version.  16 bit version left the same.             **}
{**          - Version 1.27  (03/January/1997)                       **}
{**              Moved 16 bit type declarations & global variables   **}
{**              to the implementation section.                      **}
{**          - Version 1.28  (11/January/1997)                       **}
{**              Tidied up a bit.  Added GetWindowRgn_NoCaption.     **}
{**          - Version 1.29  (13/January/1997)                       **}
{**              Added a caption refresh when destroying.            **}
{**          - Version 1.30  (24/January/1997)                       **}
{**              Removed MyOwner.Refresh (very minor).               **}
{**              Reduced spacing between successive caption parts.   **}
{**              Sent to Delphi SuperPage and Torry's Delphi Pages.  **}
{** ---------------------------------------------------------------- **}
{** Copyright- copyright 1996, 1997 by Warren F. Young.             **}
{**            Free to use and redistribute, but my name must        **}
{**            appear somewhere in the source code.  No warranty     **}
{**            is given by the author, expressed or implied.         **}
{** ---------------------------------------------------------------- **}
{** Note about MDI Applications                                      **}
{**            MDI Applications will have a drawing problem with     **}
{**            this caption component which occurs when a new child  **}
{**            is created, and that child is maximized.  To work     **}
{**            around this problem, see the file MDI_Apps.txt for    **}
{**            some code to add to the Child window creation routine.**}
{**            (Yes I know it's a nuisance - if you know a better    **}
{**            solution then please e-mail me).                      **}
{** ---------------------------------------------------------------- **}
{** Known Limitations                                                **}
{**          - In D2 (Win95), when a form has an MSOfficeCaption and **}
{**            is minimized, the caption draws funny.  This problem  **}
{**            exists only at design time (I think), so isn't serious**}
{**          - In D2 (Win95), when a form is maximized and restored, **}
{**            it zooms, and the caption draws non-shaded.           **}
{**          - The 16-bit version flickers on redraw.  In Win3.x     **}
{**            this is unavoidable.  In Win95 (D1) it may be         **}
{**            possible to fix it by calling some 32-bit functions.  **}
{** ---------------------------------------------------------------- **}
{** Possible Changes/Improvements                                    **}
{**          - In D1 (Win95), access the 32bit drawing routines for  **}
{**            drawing the system icon (DrawIconEx and CopyImage).   **}
{**          - In D1 (Win95), try accessing 32bit routines in order  **}
{**            to reduce or remove flickering when redrawing.        **}
{**          - Add a property called Spacing (or similar), to        **}
{**            determine the amount of space between Company and     **}
{**            AppName text, and AppName and Caption text.           **}
{** ---------------------------------------------------------------- **}
{** Disclaimer                                                       **}
{**          - I take no responsibility for any losses suffered      **}
{**            resulting from use or misuse of this code.  It is     **}
{**            freeware, with souorce code, and so you use (and      **}
{**            maintain) it at your own risk.                        **}
{**********************************************************************}
Good luck and happy programming.