Listed here are all the classes in the library. As I document each class, the headings below will
become hyperlinks to detailed descriptions. Unless otherwise noted, these classes live in the
ParksComputing::WindowLib namespace.
Window
This is the base class for most of the library. It provides basic methods and properties
related to window creation and manipulation. The most interesting part of writing this
class was making the Win32 window procedure play well on a C++ playground. This is done
with a static GlobalWindowProcedure method that looks for a window handle
in a hash map of handles to instances of Window objects. Once found,
the static procedure calls the instance's WindowProc method; otherwise,
it hands messages off to the default window procedure (::DefWindowProc).
Other methods are provided for window registration, creation, initialization and subclassing,
and the rest are thin wrappers around Win32 API calls that operate on window handles.
One thing that is evident in this class and which cascades to its descendants is the way
that it handles Unicode. I didn't want to introduce something like the MFC
CString class because I want this library to work well with STL, which
already provides the std::string class. Unfortunately, STL provides std::string
for 8-bit characters and std::wstring for wide characters, which would have
been cumbersome. What I did instead was create a typedef
called tstring which resolves to std::basic_string<TCHAR>.
This typedef is then used all over the library to ease string manipulation.
WindowClass
This class is derived from the base API structure WNDCLASSEX. It adds some
useful methods to the WNDCLASSEX structure, such as constructors to
initialize the fields to a sane default, assignment and equality operators,
conversion operators, and methods to assist in window registration.
Message
The Message class is derived from the base Win32 MSG class (actually
::tagMSG). Like WindowClass, it provides constructors, assignment and
equality operators, and conversion operators. It also contains an internal functor
class called TestDialogMessage, which calls ::IsDialogMessage to
determine if a message is destined for a supplied dialog handle.
WindowApp
This, as they say, is where the magic happens. Derived from the Window class,
WindowApp provides enough boilerplate code to be a fully-functional
(if somewhat dull) Win32 application. Besides overriding the WindowProc
method of Window, it supplies InitInstance and Main methods.
As seen in the example above, the Main method is the entry point into
an application written with WindowLib.
Dialog
This class provides boilerplate code for dialogs.
Besides providing a default dialog procedure, it also provides a Main
method which starts a modal instance of the dialog.
ModelessDialog
This is derived from Dialog and, as the name implies, it provides a base
class for non-modal dialogs.
DialogApp
DialogApp is the dialog equivalent to WindowApp. It provides a
Main method with the same signature as WindowApp::Main, and it
also supplies constructors that accept a dialog resource ID. This class is derived from
WindowApp.
ControlWindow
This is the base class for all dialog controls, such as buttons, list boxes, etc. The
override of Window::Create subclasses the control's window to provide a
window procedure for message handling. Also supplied are message handlers for
WM_CHAR and WM_GETDLGCODE.
Button
Control class for button controls.
Edit
Control class for edit controls.
ListBox
Control class for list box controls.
Static
Control class for static controls.
StatusBar
This class handles the creation and manipulation of window status bars.
Splitter
This is a class that was the first "value-added" class in the library, meaning
that it provides a feature beyond something provided in base Win32. It is a base
class for horizontal and vertical splitters that provide a means to resize two
adjacent windows split with a draggable bar.
HorizSplitter
Horizontal splitter class derived from Splitter.
VertSplitter
Vertical splitter class derived from Splitter.
OleControlSite
This one never went anywhere. I wanted to add the ability to host ActiveX controls,
but it was more time than I could invest when I started to work on it. Maybe one
day, when I'm really bored...