Tutorials
|
|
Menu of tutorialsTutorial 1: The Simplest Window
Up until now we have used the default parameters supplied by Win32++ to
create the view window. Here we use the PreRegisterClass to specify
the Window Class (not to be confused with a C++ class) parameters prior to
window creation. This will allow us to create a window with a colored
background and set it's cursor. We also use PreCreate to give the window a 3D look by giving it's border
a sunken edge. The cursor IDC_CURSOR1 used in PreRegisterClass is specified in
resource.rc. The resource.rc file is our resource script and contains the
specifications for various window resources such as bitmaps, dialogs,
cursors, icons, menus etc. The resources specified in resource.rc are
compiled and linked into our application. This is the specification for the
cursor in the resource.rc file. We create the background brush in CView's constructor. The brush is a
CBrush object that automatically deletes its brush when its destructor is
called. This is how the brush is created. The source code for this tutorial is located within the Tutorial folder
of the software available from SourceForge at
http://sourceforge.net/projects/win32-framework. |