COXHookWnd & COXHookWndMap

Generic class to hook messages on behalf of a CWnd.
Once hooked, all messages go to COXHookWnd::WindowProc before going to the window. Specific subclasses can trap messages and do something. To use:

•	Derive a class from COXHookWnd.
•	Override COXHookWnd::WindowProc to handle messages. Make sure you call  COXHookWnd::WindowProc if you don't handle the message, or your window will never get messages. If you write separate message handlers, you can call Default() to pass the message to the window.
•	Instantiate your derived class somewhere and call HookWindow(pWnd) to hook your window, AFTER it has been created. To unhook, call UnhookWindow().

The message hook map (class COXHookWndMap) is derived from CMapPtrToPtr, which associates a pointer with another pointer. It maps an HWND to a COXHookWnd, like the way MFC's internal maps map HWND's to CWnd's. The first hook attached to a window is stored in the map; all other hooks for that window are then chained via COXHookWnd::m_pNext.

COXCaptionInfo & COXCaptionPainter

Class COXCaptionInfo defines caption attributes. Among them are:
•	background color
•	gradient or plain filling
•	gradient alignment (can be right, left and center)
•	gradient algorithm (can be linear or squared)
•	number of color shades used for gradient filling
•	font used to draw window's text
•	window's text color
•	text output format

COXCaptionPainter class heavily uses this class. The main feature of this class is that it is serializable. That means that you can save caption info in a file or registry.

COXCaptionPainter is a generic caption painter. Derived from COXHookWnd - generic class that is used to subclass any CWnd and provides capability to handle any message routed to the hooked window before it. Handles WM_NCPAINT, WM_NCACTIVATE, and whole bunch of other messages to handle drawing custom captions. To use it:

•	call Attach from your window's OnCreate function.
•	to set caption properties create COXCaptionInfo object or get associated one using GetCaptionInfo() function. COXCaptionPainter uses different COXCaptionInfo object for active and inactive state.
•	change any COXCaptionInfo properties you want to.
•	set updated COXCaptionInfo object to COXCaptionPainter object using SetCaptionInfo() function.
•	invalidate window's caption using SendMessage(WM_NCPAINT) in order to redraw it