--- mstools/samples/generic/generic.rtf 2018/08/09 18:21:29 1.1 +++ mstools/samples/generic/generic.rtf 2018/08/09 18:23:31 1.1.1.2 @@ -1,422 +1,106 @@ {\rtf1\ansi \deff0\deflang1024{\fonttbl{\f0\froman Times New Roman;}{\f1\froman Symbol;}{\f2\fswiss Arial;}{\f3\fswiss Helvetica;}{\f4\fmodern Courier;}{\f5\fswiss Helv;}{\f6\froman Ariel;}{\f7\fmodern Courier New;} -{\f8\fswiss Univers (WN);}{\f9\froman CG Times (WN);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255; -\red0\green0\blue127;\red0\green127\blue127;\red0\green127\blue0;\red127\green0\blue127;\red127\green0\blue0;\red127\green127\blue0;\red127\green127\blue127;\red192\green192\blue192;}{\stylesheet{\s244\li120\sb80\sl-240 \f3\fs18\up6\lang1033 -\sbasedon0\snext0 footnote reference;}{\s245\li120\sb80\sl-240 \f3\fs20\lang1033 \sbasedon0\snext0 footnote text;}{\s252\li120\sb120\sa60\sl-240 \f3\fs20\lang1033 \snext0 heading 3;}{\s253\li120\sb120\sa60\sl-240 \b\f3\fs20\lang1033 \snext0 heading 2;}{ -\s254\li120\sb280\sa120\sl-320 \b\f3\lang1033 \snext10 heading 1;}{\s255\li360\sb80\sl-240 \f3\fs20\lang1033 \snext0 Normal Indent;}{\li120\sb80\sl-240 \f3\fs20\lang1033 \snext0 Normal;}{\s2\fi-240\li600\sb60\sl-240 \f3\fs20\lang1033 \snext2 Jli;}{ -\s3\li120\sb60\sl-240\keep\tx520\tx920\tx1320\tx1720\tx2120 \f4\fs16\lang1033 \snext3 Ex;}{\s4\li120\sb160\sl-240 \f3\fs20\lang1033 \snext13 Sa1;}{\s5\fi-240\li360\sl-240\tx360 \f3\fs20\lang1033 \snext6 Lb1;}{\s6\fi-240\li360\sb60\sl-240\tx360 -\f3\fs20\lang1033 \snext6 Lb2;}{\s7\li360\sb60\sl-240 \f3\fs20\lang1033 \snext6 Lp1;}{\s8\fi-1800\li1920\sb120\sa40\sl-240\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1920 \b\f3\fs20\lang1033 \snext9 Th;}{ -\s9\fi-1800\li1920\sb60\sl-240\tx1920 \f3\fs20\lang1033 \snext9 Tp;}{\s10\li120\sl-240 \f3\fs20\lang1033 \snext0 Normal 2;}{\s11\li120\sb120\sa120 \f3\fs20\lang1033 \snext0 bitmap;}{\s12\li120\sb120\sl-240 \f3\fs20\lang1033 \snext13 Sa2;}{ -\s13\fi-240\li360\sb60\sl-240 \f3\fs20\lang1033 \snext13 Jl;}{\s14\li120\sa60 \f8\fs20\lang1033 \snext14 *body;}{\s15\li120\sa60 \b\f8\fs20\lang1033 \snext15 *heading;}{\s16\li120\sa60\sl-240 \f8\fs20\lang1033 \sbasedon14\snext16 para;}{ -\s17\fi-280\li400\sa60 \f8\fs20\lang1033 \sbasedon14\snext17 jump;}{\s18\fi-280\li400\sa60\tx400 \f8\fs20\lang1033 \sbasedon14\snext18 list bullet;}{\s19\fi-280\li600\sa60 \f8\fs20\lang1033 \sbasedon14\snext19 jump indent;}{\s20\li120\sa60\sl-40\brdrb -\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \f8\fs20\lang1033 \sbasedon14\snext20 table rule;}{\s21\fi-280\li400\sa60\tqr\tx280\tx400 \f8\fs20\lang1033 \sbasedon14\snext21 list number;}{\s22\li120\sb100\sa60 \b\f8\fs20\lang1033 -\sbasedon15\snext17 see also;}{\s23\li400\sa60 \f8\fs20\lang1033 \sbasedon14\snext23 para indent;}{\s24\fi-1800\li1920\tx1920 \b\f8\fs20\lang1033 \sbasedon15\snext20 table head;}{\s25\fi-1800\li1920\sa60\tx1920 \f8\fs20\lang1033 -\sbasedon14\snext25 table text;}{\s26\li120\sb120\sa60 \f8\fs20\lang1033 \sbasedon14\snext19 see also 2;}{\s27\li120\sa60\keep\tx520\tx920\tx1320\tx1720\tx2120 \f4\fs20\lang1033 \sbasedon14\snext27 code;}{\s28\sl-120 \f9\fs20\lang1033 \snext16 *spacing;}{ -\s29\sl-120 \f9\fs20\lang1033 \sbasedon28\snext29 s6;}{\s30\qj\li360 \lang1033 \sbasedon0\snext30 Help Text;}}{\info{\author TRIO}{\creatim\yr1992\mo6\dy24\hr16\min51}{\version1}{\edmins256}{\nofpages14}{\nofwords2490}{\nofchars14208}{\vern16504}} -\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0 {\*\template C:\\WINAPPS\\WINWORD\\WHAT31.DOT}\sectd \linex0 \pard\plain \keepn \f3\fs20\lang1033 {\fs16\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 { -\fs16\up6 $} Contents}} {\fs16\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs16\up6 #} Contents}} {\fs16\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs16\up6 K} Contents}} \{bmc generic.bmp\} { -\b\f2\fs32 Contents for Generic Application Help}{\plain \b\f2\lang1033 +{\f8\fswiss Univers (WN);}{\f9\froman CG Times (WN);}{\f10\fswiss MS Sans Serif;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue127;\red0\green127\blue127;\red0\green127\blue0;\red127\green0\blue127;\red127\green0\blue0;\red127\green127\blue0;\red127\green127\blue127;\red192\green192\blue192;}{\stylesheet{\s244\li120\sb80\sl-240 +\f3\fs18\up6\lang1033 \sbasedon0\snext0 footnote reference;}{\s245\li120\sb80\sl-240 \f3\fs20\lang1033 \sbasedon0\snext0 footnote text;}{\s251\fi-245\li360\sb120\sa60\sl-240 \f10\fs20\lang1033 \sbasedon253\snext251 heading 4;}{ +\s252\li120\sb120\sa60\sl-240 \f3\fs20\lang1033 \snext0 heading 3;}{\s253\li120\sb120\sa60\sl-240 \b\f3\fs20\lang1033 \snext0 heading 2;}{\s254\li120\sb280\sa120\sl-320 \b\f3\lang1033 \snext10 heading 1;}{\s255\li360\sb80\sl-240 \f3\fs20\lang1033 +\snext0 Normal Indent;}{\li120\sb80\sl-240 \f3\fs20\lang1033 \snext0 Normal;}{\s2\fi-240\li600\sb60\sl-240 \f3\fs20\lang1033 \snext2 Jli;}{\s3\li120\sb60\sl-240\keep\tx520\tx920\tx1320\tx1720\tx2120 \f4\fs16\lang1033 \snext3 Ex;}{\s4\li120\sb160\sl-240 +\f3\fs20\lang1033 \snext13 Sa1;}{\s5\fi-240\li360\sl-240\tx360 \f3\fs20\lang1033 \snext6 Lb1;}{\s6\fi-240\li360\sb60\sl-240\tx360 \f3\fs20\lang1033 \snext6 Lb2;}{\s7\li360\sb60\sl-240 \f3\fs20\lang1033 \snext6 Lp1;}{\s8\fi-1800\li1920\sb120\sa40\sl-240 +\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1920 \b\f3\fs20\lang1033 \snext9 Th;}{\s9\fi-1800\li1920\sb60\sl-240\tx1920 \f3\fs20\lang1033 \snext9 Tp;}{\s10\li120\sl-240 \f3\fs20\lang1033 \snext0 Normal 2;}{\s11\li120\sb120\sa120 +\f3\fs20\lang1033 \snext0 bitmap;}{\s12\li120\sb120\sl-240 \f3\fs20\lang1033 \snext13 Sa2;}{\s13\fi-240\li360\sb60\sl-240 \f3\fs20\lang1033 \snext13 Jl;}{\s14\li120\sa60 \f8\fs20\lang1033 \snext14 *body;}{\s15\li120\sa60 \b\f8\fs20\lang1033 +\snext15 *heading;}{\s16\li120\sa60\sl-240 \f8\fs20\lang1033 \sbasedon14\snext16 para;}{\s17\fi-280\li400\sa60 \f8\fs20\lang1033 \sbasedon14\snext17 jump;}{\s18\fi-280\li400\sa60\tx400 \f8\fs20\lang1033 \sbasedon14\snext18 list bullet;}{ +\s19\fi-280\li600\sa60 \f8\fs20\lang1033 \sbasedon14\snext19 jump indent;}{\s20\li120\sa60\sl-40\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \f8\fs20\lang1033 \sbasedon14\snext20 table rule;}{\s21\fi-280\li400\sa60\tqr\tx280\tx400 +\f8\fs20\lang1033 \sbasedon14\snext21 list number;}{\s22\li120\sb100\sa60 \b\f8\fs20\lang1033 \sbasedon15\snext17 see also;}{\s23\li400\sa60 \f8\fs20\lang1033 \sbasedon14\snext23 para indent;}{\s24\fi-1800\li1920\tx1920 \b\f8\fs20\lang1033 +\sbasedon15\snext20 table head;}{\s25\fi-1800\li1920\sa60\tx1920 \f8\fs20\lang1033 \sbasedon14\snext25 table text;}{\s26\li120\sb120\sa60 \f8\fs20\lang1033 \sbasedon14\snext19 see also 2;}{\s27\li120\sa60\keep\tx520\tx920\tx1320\tx1720\tx2120 +\f4\fs20\lang1033 \sbasedon14\snext27 code;}{\s28\sl-120 \f9\fs20\lang1033 \snext16 *spacing;}{\s29\sl-120 \f9\fs20\lang1033 \sbasedon28\snext29 s6;}{\s30\qj\li360 \lang1033 \sbasedon0\snext30 Help Text;}{\s31\li115\sb120\sa40\sl-240\brdrb +\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \f10\fs20\lang1033 \sbasedon8\snext9 Th2;}{\s32\li115\sb120\sa40\sl-240\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \b\f10\fs16\lang1033 \sbasedon8\snext9 Th3;}{\s33\li115\sb200\sl-240 +\f10\fs20\lang1033 \sbasedon0\snext0 Normal 3;}{\s34\fi-1800\li1915\sb120\sa40\sl-240\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1915 \b\f10\fs20\lang1033 \sbasedon0\snext35 Thh;}{\s35\fi-1800\li1915\sb60\sl-240\tx1915 \f10\fs20\lang1033 +\sbasedon0\snext35 Tph;}}{\info{\author TRIO}{\creatim\yr1992\mo6\dy24\hr16\min51}{\version1}{\edmins357}{\nofpages2}{\nofwords66236}{\nofchars69347}{\vern16504}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0 {\*\template +C:\\WINAPPS\\WINWORD\\WHAT31.DOT}\sectd \linex0 \pard\plain \keepn \f3\fs20\lang1033 {\fs16\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs16\up6 $} Contents}} {\fs16\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 +\f3\fs20\lang1033 {\fs16\up6 #} Contents}} {\fs16\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs16\up6 K} Contents}} \{bmc generic.bmp\} {\b\f2\fs32 GENERIC: Simple Example Application}{\b\f2\fs32 \par }\pard \li120 {\f2 +\par }{\field{\*\fldinst {\f2 include GENERIC.DOC}}{\fldrslt {\f2 GENERIC is a sample application that illustrates what could be considered a 'mimimum' implementation of a Windows application.}{\f2 \par }{\f2 -The Windows SDK Generic Application Example is a sample application that you can use to get an idea of how to perform some of the simple functionality that all Applications written for Microsoft Windows should implement. You can use this application as ei -}{\f2 ther a starting point from which to build your own applications, or for quickly testing out functionality of an interesting Windows API.}{\f2 +\par }{\f2 While it would be possible to write an application that was far more minimum then GENERIC, such an application would not implement some of the features of a Windows application that many users would consider 'standard'.}{\f2 \par }{\f2 -\par }{\f2 This application is source compatible for with Windows 3.1 and Windows NT.}{\f2 +\par }{\f2 The features that GENERIC implements:}{\f2 \par }{\f2 -\par }{\f2 Code Fragments with explainations:}{\f2 +\par }\pard \li720 {\f2 Custom Icon}{\f2 +\par }{\f2 Standard Menu Bar}{\f2 +\par }\pard \fi-1320\li2040 {\f2 Standard Help Menu}{\f2 +\par }{\f2 Full WinHelp Support}{\f2 +\par }{\f2 Keyboard Accelerator Usage}{\f2 +\par }{\f2 Version Control Information}{\f2 +\par }{\f2 Full Win16, Win32s, Win32 Common Source Code}{\f2 +\par }\pard \fi-1320\li1440 {\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Custom Icon}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab }{\f2 While this might appear to be a t}{\f2 rivial and obvious feature, it is suprising how many sample applicaitons fail to implement this.}{\f2 +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\b\f2 GENERIC.ICO}{\f2 : This contains the bitmap representation of the icon. It was created with the icon editor application that comes with the SDK.}{\f2 +\par }{\f2 +\par }{\b\f2 GENERIC.RC}{\f2 : This file defines all of the resources used by the application, including the ICON resource type that will allow the custom icon to be loaded.}{\f2 +\par }{\f2 +\par }{\b\f2 GENERIC.C}{\f2 : Loads the ICON resource, and assigns it to the }{\i\f2 hIcon}{\f2 element of the }{\i\f2 WNDCLASS}{\f2 structure that is passed into the }{\i\f2 RegisterClass}{\f2 call.}{\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 An 'About...' Box With Custom Icon And Font Style}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab }{\f2 +Many sample applications simply use a call to 'MessageBox' to put up their 'About' box (if they even bother to do so at all). This application goes a little further by not only creating an actual dialog box, but by also taking the few extra steps that mak +}{\f2 e the dialog look better, and contain useful information.}{\f2 +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 GENERI}{\f2 C.DLG}{\f2 +\par }{\f2 GENERIC.RC}{\f2 +\par }{\f2 GENERIC.RCV}{\f2 +\par }{\f2 GENERIC.C}{\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Standard Menu Bar}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab }{\f2 The book "The Windows Interface: An Application Design Guide", presents a recommended standard menu bar configuration. As closely as appropriate, this application follows the presented layout.}{\f2 +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 GENERIC.RC}{\f2 +\par }{\f2 GENERIC.C}{\f2 +\par }{\f2 +\par }\pard \fi-1320\li1440 {\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Standard Help Menu}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Full WinHelp Support}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Keyboard Accelerator Usage}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Version Control Information}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 +\par }\pard \fi-1320\li1440 {\f2 +\par }{\b\f2 \page }{\b\f2 Feature:}{\f2 }{\f2 \tab }{\f2 Full Win16, Win32s, Win32 Common Source Code}{\f2 +\par }{\b\f2 Description:}{\f2 }{\f2 \tab +\par }{\b\f2 Files used to implement Feature:}{\f2 +\par }\pard \fi-720\li1440 {\f2 \par }{\f2 -\par }\pard \fi-1440\li2160\tx2160 {\f2\uldb Global Declarations}{\v\f2 Globals}{\f2 -\par }{\f2\uldb WinMain}{\v\f2 WinMain}{\f2 \tab }{\f2 : Calls initialization function, processes message loop}{\f2 -\par }{\f2\uldb InitApplication}{\v\f2 InitApplication}{\f2 \tab }{\f2 : Initializes window data and registers window}{\f2 -\par }{\f2\uldb InitInstance}{\v\f2 InitInstance}{\f2 \tab }{\f2 : Saves instance handle and creates main window}{\f2 -\par }{\f2\uldb WndProc}{\v\f2 WndProc}{\f2 \tab }{\f2 : Processes messages}{\f2 -\par }{\f2\uldb CenterWindow}{\v\f2 CenterWindow}{\f2 \tab }{\f2 : Used to center the "About" box over application window}{\f2\uldb -\par }{\f2\uldb About}{\v\f2 About}{\f2 \tab }{\f2 : Processes messages for "About" dialog box}{\f2 -\par }\pard \li115 {\f2 +\par }\pard \fi-1320\li1440 }}\pard\plain \fi-1320\li1440 \f3\fs20\lang1033 {\f2 +\par }\pard \li120 {\f2 \page }{\f2 This is a sample WinHelp source document. To easily modify this }{\f2 document to customize it for use in your application perform the following steps:}{\f2 \par }{\f2 -\par }\pard \li115\keepn {\f2 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} Globals}}{\f2 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} Globals}}{\f2 }{ -\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} Globals}}{\f2 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} Globals}}{\f2 }{\plain \b\f2\lang1033 Global Declarations -}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 #include }\tab {\i\cf2 // required for all Windows applications} -\par {\f7\fs18 #include "generic.h"}{\f7\fs18 \tab }{\i\fs18\cf2 // specific to this program}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 #if !defined (APIENTRY)}{\i\fs18\cf2 \tab }{\i\fs18\cf2 // Windows NT defines APIENTRY, but 3.x doesn't}{\f7\fs18 -\par }{\f7\fs18 #define APIENTRY far pascal}{\f7\fs18 -\par }{\f7\fs18 #endif}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 #if defined(WIN32)}{\f7\fs18 \tab }{\i\fs18\cf2 // Windows NT uses a WNDPROC for dialogs, 3.x a FARPROC}{\f7\fs18 -\par }{\f7\fs18 #define DLGPROC WNDPROC}{\f7\fs18 -\par }{\f7\fs18 #else}{\f7\fs18 -\par }{\f7\fs18 #define DLGPROC FARPROC}{\f7\fs18 -\par }{\f7\fs18 #endif}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 HANDLE hInst;}{\f7\fs18 \tab }{\i\fs18\cf2 // current instance}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 char szAppName[] = "Generic";}{\f7\fs18 \tab }{\i\fs18\cf2 // The name of this application}{\f7\fs18 -\par }{\f7\fs18 char szTitle[] = "Generic Sample Application";}{\f7\fs18 \tab }{\i\fs18\cf2 // The title bar text}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }\pard \li115\keepn {\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} WinMain}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} WinMain}}{ -\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} WinMain}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} WinMain}}{\plain \b\f2\lang1033 } -{\plain \b\f2\lang1033 WinMain Function}{\plain \b\f2\lang1033 -\par }\pard \fi-1320\li1440\sb80\sl-240\tx1440 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 WinMain(HANDLE, HANDLE, LPSTR, int)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Calls initialization function, processes message loop}{\f2 -\par }{\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 -Windows recognizes this function by name as the initial entry point for the program. This function calls the application initialization routine, if no other instance of the program is running, and always calls the instance initialization routine. It the -}{\f2 -n executes a message retrieval and dispatch loop that is the top-level control structure for the remainder of execution. The loop is terminated when a WM_QUIT message is received, at which time this function exits the application instance by returning th -}{\f2 e }{\f2 value passed by PostQuitMessage().}{\f2 -\par }\pard \fi-1320\li1440\sb80\sl-240 {\f2 -\par }\pard \li1440\sb80\sl-240 {\f2 If this function must abort before entering the message loop, it returns the conventional value NULL.}{\f2 -\par }\pard \li120\sb80\sl-240 {\f2 -\par }{\f7\fs18 int APIENTRY WinMain(}{\f7\fs18 -\par }{\f7\fs18 HANDLE hInstance,}{\f7\fs18 -\par }{\f7\fs18 HANDLE hPrevInstance,}{\f7\fs18 -\par }{\f7\fs18 LPSTR lpCmdLine,}{\f7\fs18 -\par }{\f7\fs18 int nCmdShow)}{\f7\fs18 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 MSG msg;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 if (!hPrevInstance)}{\f7\fs18 \tab }{\f7\fs18 \{}{\f7\fs18 \tab }{\i\fs18\cf2 // Other instances of app running?}{\f7\fs18 -\par }{\f7\fs18 if (!InitApplication(hInstance)) }{\f7\fs18 \{}{\f7\fs18 \tab }{\i\fs18\cf2 // Initialize shared things}{\f7\fs18 -\par }{\f7\fs18 return (FALSE);}{\f7\fs18 \tab }{\i\fs18\cf2 // Exits if unable to initialize}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Perform initializations that apply to a specific instance}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 if (!InitInstance(hInstance, nCmdShow)) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 return (FALSE);}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Acquire and dispatch messages until a WM_QUIT message is received.}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 while (GetMessage(&msg,}{\f7\fs18 \tab }{\i\fs18\cf2 // message structure}{\f7\fs18 -\par }{\f7\fs18 NULL,}{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\fs18\cf2 // handle of window receiving the message}{\f7\fs18 -\par }{\f7\fs18 NULL,}{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\fs18\cf2 // lowest message to examine}{\f7\fs18 -\par }{\f7\fs18 NULL))}{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\fs18\cf2 // highest message to examine}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 TranslateMessage(&msg);}{\f7\fs18 \tab }{\i\fs18\cf2 // Translates virtual key codes}{\f7\fs18 -\par }{\f7\fs18 DispatchMessage(&msg);}{\f7\fs18 \tab }{\i\fs18\cf2 // Dispatches message to window}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 return (msg.wParam);}{\f7\fs18 \tab }{\i\fs18\cf2 // Returns the value from PostQuitMessage}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 lpCmdLine;}{\f7\fs18 \tab }{\i\fs18\cf2 // This will prevent 'unused formal parameter' warnings}{\f7\fs18 -\par }\pard \li120 {\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }\pard \li115\keepn {\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} InitApplication}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} - InitApplication}}{\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} InitApplication}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} - InitApplication}}{\fs18\up6 }{\plain \b\f2\lang1033 InitApplication Function}{\fs18\up6 -\par }\pard \fi-1320\li1440\sb80\sl-240\tx1440 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 InitApplication(HANDLE)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Initializes window data and registers window class}{\f2 -\par }{\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 This function is called at initialization time only if no other instances of the application are running. This function performs initialization tasks that can be done once for any number of running instances.}{\f2 - +\par }{\f2 (Assuming you are using Windows Word other document editors could be used, but you are on your own for doing the appropriate conversions)}{\f2 \par }{\f2 -\par }\pard \li1440\sb80\sl-240\tx1440 {\f2 -In this case, we initialize a window class by filling out a data structure of type WNDCLASS and calling the Windows RegisterClass() function. Since all instances of this application use the same window class, we only need to do this when the first instan -}{\f2 ce is initialized.}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 -\par }{\f7\fs18 BOOL InitApplication(H}{\f7\fs18 ANDLE hInstance)}{\f7\fs18 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 WNDCLASS wc;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Fill in window class structure with parameters that describe the main window.}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 wc.style = CS_HREDRAW | CS_VREDRAW;}{\f7\fs18 \tab }{\i\fs18\cf2 // Class style(s)}{\i\fs18\cf2 -\par }{\f7\fs18 wc.lpfnWndProc = (WNDPROC)WndProc;}{\f7\fs18 \tab }{\i\fs18\cf2 // Window Procedure}{\i\fs18\cf2 -\par }{\f7\fs18 wc.cbClsExtra = 0;}{\f7\fs18 \tab }{\i\fs18\cf2 // No per-class extra data.}{\i\fs18\cf2 -\par }{\f7\fs18 wc.cbWndExtra = 0;}{\f7\fs18 \tab }{\i\fs18\cf2 // No per-window extra data.}{\i\fs18\cf2 -\par }{\f7\fs18 wc.hInstance = hInstance;}{\f7\fs18 \tab }{\i\fs18\cf2 // Owner of this class}{\i\fs18\cf2 -\par }{\f7\fs18 wc.hIcon = LoadIcon (hInstance, szAppName); }{\i\fs18\cf2 // Icon name from .RC}{\i\fs18\cf2 -\par }{\f7\fs18 wc.hCursor = LoadCursor(NULL, IDC_ARROW);}{\i\fs18\cf2 // Cursor}{\i\fs18\cf2 -\par }{\f7\fs18 wc.hbrBackground = COLOR_WINDOW+1;}{\f7\fs18 \tab }{\i\fs18\cf2 // Default color}{\i\fs18\cf2 -\par }{\f7\fs18 wc.lpszMenuName = szAppName;}{\f7\fs18 \tab }{\i\fs18\cf2 // Menu name from .RC}{\i\fs18\cf2 -\par }{\f7\fs18 wc.lpszClassName = szAppName;}{\f7\fs18 \tab }{\i\fs18\cf2 // Name to register as}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Register the window class and return success/failure code.}{\i\fs18\cf2 -\par }{\f7\fs18 return (RegisterClass(&wc));}{\f7\fs18 -\par }\pard \li115 {\f7\fs18 \}}{\f7\fs18 -\par }\pard \li115\keepn {\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} InitInstance}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} - InitInstance}}{\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} InitInstance}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} InitInstance}} -{\plain \b\f2\lang1033 }{\plain \b\f2\lang1033 InitInstance Function}{\f7\fs18 -\par }\pard \fi-1320\li1440\sb80\sl-240\tx1440 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 InitInstance(HANDLE, int)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Saves instance handle and creates main window}{\f2 -\par }{\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 This function is called at initialization time for every instance of this application. This function performs initialization tasks that cannot be shared by multiple instances.}{\f2 -\par }{\f2 -\par }\pard \li1440\sb80\sl-240\tx1440 {\f2 In this case, we save the instance handle in a static variable and create and display the main program window.}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 -\par }{\f7\fs18 BOOL InitInstance(}{\f7\fs18 -\par }{\f7\fs18 HANDLE hInstance,}{\f7\fs18 -\par }{\f7\fs18 int nCmdShow)}{\f7\fs18 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 HWND hWnd;}{\f7\fs18 \tab }{\i\fs18\cf2 // Main window handle.}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Save the instance handle in static variable, which will be used in}{\i\fs18\cf2 -\par }{\i\fs18\cf2 // many subsequence calls from this application to Windows.}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 hInst = hInstance;}{\f7\fs18 \tab }{\i\fs18\cf2 // Store instance handle in our global variable}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Create a main window for this application instance.}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 hWnd = CreateWindow(}{\f7\fs18 -\par }{\f7\fs18 szAppName,}{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\fs18\cf2 // See RegisterClass() call.}{\i\fs18\cf2 -\par }{\f7\fs18 szTitle, }{\f7\fs18 \tab }{\i\fs18\cf2 // Text for window title bar.}{\i\fs18\cf2 -\par }{\f7\fs18 WS_OVERLAPPEDWINDOW,}{\f7\fs18 \tab }{\i\fs18\cf2 // Window style.}{\i\fs18\cf2 -\par }{\f7\fs18 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,}{\f7\fs18 \tab }{\i\fs18\cf2 // Use default positioning}{\i\fs18\cf2 -\par }{\f7\fs18 NULL,}{\f7\fs18 \tab }{\i\fs18\cf2 // Overlapped windows have no parent.}{\i\fs18\cf2 -\par }{\f7\fs18 NULL,}{\f7\fs18 \tab }{\i\fs18\cf2 // Use the window class menu.}{\i\fs18\cf2 -\par }{\f7\fs18 hInstance,}{\f7\fs18 \tab }{\i\fs18\cf2 // This instance owns this window.}{\i\fs18\cf2 -\par }{\f7\fs18 NULL}{\f7\fs18 \tab }{\i\fs18\cf2 // We don't use any data in our WM_CREATE}{\i\fs18\cf2 -\par }{\f7\fs18 );}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // If window could not be created, return "failure"}{\i\fs18\cf2 -\par }{\f7\fs18 if (!hWnd) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 return (FALSE);}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Make the window visible; update its client area; and return "success"}{\i\fs18\cf2 -\par }{\f7\fs18 ShowWindow(hWnd, nCmdShow);}{\f7\fs18 \tab }{\i\fs18\cf2 // Show the window}{\i\fs18\cf2 -\par }{\f7\fs18 UpdateWindow(hWnd);}{\f7\fs18 \tab }{\i\fs18\cf2 // Sends WM_PAINT message}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 return (TRUE);}{\f7\fs18 \tab }{\i\fs18\cf2 // We succeeded}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }\pard \li120 {\f7\fs18 \}}{\f7\fs18 -\par }\pard \li115\keepn {\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} WndProc}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} WndProc}}{ -\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} WndProc}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} WndProc}}{\f7\fs18 }{\plain -\b\f2\lang1033 WndProc Function}{\f7\fs18 -\par }\pard \li120\sb80\sl-240\tx1440 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 WndProc(HWND, UINT, UINT, LONG)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Processes messages}{\f2 -\par }{\b\f2 MESSAGES}{\f2 :}{\f2 -\par }\pard \li1440\sb80\sl-240\tx1440 {\f2 WM_COMMAND - application menu (About dialog box)}{\f2 -\par }{\f2 WM_DESTROY - destroy window}{\f2 -\par }\pard \li120\sb80\sl-240\tx1440 {\f2 -\par }\pard \fi-1320\li1440\sb80\sl-240\tx1440 {\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 -To process the IDM_ABOUT message, call MakeProcInstance() to get the current instance address of the About() function. Then call Dialog box which will create the box according to the information in your }{\f2 -generic.rc file and turn control over to the About() function. When it returns, free the instance address.}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 -\par }\pard \li120\tx450\tx720\tx990\tx1260\tx1530\tx1800\tx2070\tx2340\tx2610\tx2880 {\f7\fs18 LONG APIENTRY WndProc(}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 HWND hWnd,}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // window handle}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 UINT message,}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // type of message}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 UINT uParam,}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // additional information}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 LONG lParam)}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // additional information}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 FARPROC lpProcAbout;}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // pointer to the "About" function}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 int wmId, wmEvent;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 switch (message) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 case WM_COMMAND:}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // message: command from application menu}{\i\f2\fs18\cf2 -\par }{\f7\fs18 -\par }{\i\f2\fs18\cf2 // Message packing of uParam and lParam have changed for Win32, let us}{\i\f2\fs18\cf2 -\par }{\i\f2\fs18\cf2 // handle the differences in a conditional compilation:}{\i\f2\fs18\cf2 -\par }{\f7\fs18 #if defined (WIN32)}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 wmId = LOWORD(uParam);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 wmEvent = HIWORD(uParam);}{\f7\fs18 -\par }{\f7\fs18 #else}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 wmId = uParam;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 wmEvent = HIWORD(lParam);}{\f7\fs18 -\par }{\f7\fs18 #endif}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 switch (wmId) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_ABOUT:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 lpProcAbout = MakeProcInstance((FARPROC)About, hInst);}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 DialogBox(hInst,}{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\f2\fs18\cf2 // current instance}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 "AboutBox",}{\f7\fs18 \tab }{\f7\fs18 \tab }{\i\f2\fs18\cf2 // dlg resource to use}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 hWnd,}{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\i\f2\fs18\cf2 // parent handle}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 (DLGPROC)lpProcAbout);}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // About() instance address}{\i\f2\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 FreeProcInstance(lpProcAbout);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_EXIT:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 DestroyWindow (hWnd);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_HELPCONTENTS:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 if (!WinHelp (hWnd, "GENERIC.HLP", HELP_KEY, (DWORD)(LPSTR)"CONTENTS")) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 MessageBox (GetFocus(),}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 "Unable to activate help",}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_HELPSEARCH:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 if (!WinHelp(hWnd, "GENERIC.HLP", HELP_PARTIALKEY, (DWORD)(LPSTR)"")) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 MessageBox (GetFocus(),}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 "Unable to activate help",}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_HELPHELP:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 if(!WinHelp(hWnd, (LPSTR)NULL, HELP_HELPONHELP, 0)) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 MessageBox (GetFocus(),}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 "Unable to activate help",}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab \tab }{\f7\fs18 szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\f2\fs18\cf2 // Here are all the other possible menu options,}{\i\f2\fs18\cf2 -\par }{\i\f2\fs18\cf2 // all of these are currently disabled:}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_NEW:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_OPEN:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_SAVE:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_SAVEAS:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_UNDO:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_CUT:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_COPY:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_PASTE:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_LINK:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 case IDM_LINKS:}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 default:}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 return (DefWindowProc(hWnd, message, uParam, lParam));}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 case WM_DESTROY:}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // message: window being destroyed}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 PostQuitMessage(0);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 default:}{\f7\fs18 \tab }{\i\f2\fs18\cf2 // Passes it on if unproccessed}{\i\f2\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 return (DefWindowProc(hWnd, message, uParam, lParam));}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 return (NULL);}{\f7\fs18 -\par }{\f7\fs18 \}}{\f7\fs18 -\par }\pard \li115\keepn {\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} CenterWindow}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} - CenterWindow}}{\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} CenterWindow}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} CenterWindow}} -{\plain \b\f2\lang1033 }{\plain \b\f2\lang1033 CenterWindow Function}{\f7\fs18 -\par }\pard \fi-1320\li1440\sb80\sl-240\tx1440 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 CenterWindow (HWND, HWND)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Center one window over another}{\f2 -\par }{\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 Dialog boxes take on the screen position that they were designed at, which is not always appropriate. Centering the dialog over a particular window usually results in a better position}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 -\par }{\f7\fs18 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)}{\f7\fs18 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 RECT rChild, rParent;}{\f7\fs18 -\par }{\f7\fs18 int wChild, hChild, wParent, hParent;}{\f7\fs18 -\par }{\f7\fs18 int wScreen, hScreen, xNew, yNew;}{\f7\fs18 -\par }{\f7\fs18 HDC hdc;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Get the Height and Width of the child window}{\i\fs18\cf2 -\par }{\f7\fs18 GetWindowRect (hwndChild, &rChild);}{\f7\fs18 -\par }{\f7\fs18 wChild = rChild.right - rChild.left;}{\f7\fs18 -\par }{\f7\fs18 hChild = rChild.bottom - rChild.top;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Get the Height and Width of the parent window}{\i\fs18\cf2 -\par }{\f7\fs18 GetWindowRect (hwndParent, &rParent);}{\f7\fs18 -\par }{\f7\fs18 wParent = rParent.right - rParent.left;}{\f7\fs18 -\par }{\f7\fs18 hParent = rParent.bottom - rParent.top;}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Get the display limits}{\i\fs18\cf2 -\par }{\f7\fs18 hdc = GetDC (hwndChild);}{\f7\fs18 -\par }{\f7\fs18 wScreen = GetDeviceCaps (hdc, HORZRES);}{\f7\fs18 -\par }{\f7\fs18 hScreen = GetDeviceCaps (hdc, VERTRES);}{\f7\fs18 -\par }{\f7\fs18 ReleaseDC (hwndChild, hdc);}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Calculate new X position, then adjust for screen}{\i\fs18\cf2 -\par }{\f7\fs18 xNew = rParent.left + ((wParent - wChild) /2);}{\f7\fs18 -\par }{\f7\fs18 if (xNew < 0) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 xNew = 0;}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 else if ((xNew+wChild) > wScreen) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 xNew = wScreen - wChild;}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 -\par }{\i\fs18\cf2 // Calculate new Y position, then adjust for screen}{\i\fs18\cf2 -\par }{\f7\fs18 yNew = rParent.}{\f7\fs18 top + ((hParent - hChild) /2);}{\f7\fs18 -\par }{\f7\fs18 if (yNew < 0) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 yNew = 0;}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 else if ((yNew+hChild) > hScreen) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 yNew = hScreen - hChild;}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 }{\f7\fs18 -\par }{\i\cf2 // Set it, and return}{\i\cf2 -\par }{\f7\fs18 return SetWindowPos (hwndChild, NULL, }{\f7\fs18 -\par }{\f7\fs18 xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);}{\f7\fs18 -\par }\pard \li115 {\f7\fs18 \}}{\f7\fs18 \page }{\fs18\up6 ${\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 $} About}}{\f7\fs18 }{\fs18\up6 #{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 #} About}}{ -\f7\fs18 }{\fs18\up6 +{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 +} About}}{\f7\fs18 }{\fs18\up6 K{\footnote \pard\plain \s245\li120\sb80\sl-240 \f3\fs20\lang1033 {\fs18\up6 K} About}}{\plain \b\f2\lang1033 }{\plain -\b\f2\lang1033 About Dialog Function}{\f7\fs18 -\par }\pard \li120\sb80\sl-240 {\b\f2 FUNCTION}{\f2 :}{\f2 \tab }{\f2 About(HWND, unsigned, WORD, LONG)}{\f2 -\par }{\b\f2 PURPOSE}{\f2 :}{\f2 \tab }{\f2 Processes messages for "About" dialog box}{\f2 -\par }{\b\f2 MESSAGES}{\f2 :}{\f2 -\par }\pard \li1440\sb80\sl-240 {\f2 WM_INITDIALOG - initialize dialog box}{\f2 -\par }{\f2 WM_COMMAND - Input received}{\f2 -\par }{\f2 -\par }\pard \fi-1320\li1440\sb80\sl-240 {\b\f2 COMMENTS}{\f2 :}{\f2 \tab }{\f2 Display program version information based on settings from the Version section in the resource. Wait for user to click on "Ok" button, then close the dialog box.}{\f2 -\par }\pard \li120\sb80\sl-240 {\f7\fs18 -\par }{\f7\fs18 -\par }\pard \li120\sb80\sl-240\tx450\tx720\tx990\tx1260\tx1530\tx1800\tx2070\tx2340\tx2610\tx2880 {\f7\fs18 BOOL APIENTRY About(}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 HWND hDlg,}{\f7\fs18 \tab \tab }{\i\fs18\cf2 // window handle of the dialog box}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 UINT message,}{\f7\fs18 \tab }{\i\fs18\cf2 // type of message}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 UINT uParam,}{\f7\fs18 \tab \tab }{\i\fs18\cf2 // message-specific information}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 LONG lParam)}{\f7\fs18 -\par }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 static HFONT hfontDlg;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 LPSTR lpVersion; }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 DWORD dwVerInfoSize;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 DWORD dwVerHnd;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 WORD wVersionLen;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 WORD wRootLen;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 BOOL bRetCode;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 int i;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 char szFullPath[256];}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 char szResult[256];}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 char szGetName[256];}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 switch (message) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 case WM_INITDIALOG:}{\f7\fs18 \tab }{\i\fs18\cf2 // message: initialize dialog box}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0,}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 0, 0, 0, 0,}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 VARIABLE_PITCH | FF_SWISS, "");}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 if (dwVerInfoSize) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 LPSTR lpstrVffInfo;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 HANDLE hMem;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 lpstrVffInfo = GlobalLock(hMem);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 lstrcpy(szGetName, "}{\f7\fs18 \\}{\f7\fs18 \\}{\f7\fs18 StringFileInfo}{\f7\fs18 \\}{\f7\fs18 \\}{\f7\fs18 040904E4}{\f7\fs18 \\}{\f7\fs18 \\}{\f7\fs18 ");}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 wRootLen = lstrlen(szGetName);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 GetDlgItemText(hDlg, i, szResult, sizeof(szResult));}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 szGetName[wRootLen] = (char)0;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 lstrcat (szGetName, szResult);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 wVersionLen = 0;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 lpVersion = NULL;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 (LPSTR)szGetName,}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 (void FAR* FAR*)&lpVersion,}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 (UINT FAR *) &wVersionLen);}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 if ( bRetCode && wVersionLen && lpVersion) }{\f7\fs18 \{}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 lstrcpy(szResult, lpVersion);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 SetDlgItemText(hDlg, i, szResult);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab \tab }{\f7\fs18 SendMessage (GetDlgItem (hDlg, i), WM_SETFONT, (UINT)hfontDlg, TRUE);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 \}}{\f7\fs18 }{\i\fs18\cf2 // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 GlobalUnlock(hMem);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 GlobalFree(hMem);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 \}}{\f7\fs18 }{\i\fs18\cf2 // if (dwVerInfoSize)}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 return (TRUE);}{\f7\fs18 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab }{\f7\fs18 case WM_COMMAND:}{\f7\fs18 \tab \tab }{\f7\fs18 \tab \tab }{\i\fs18\cf2 // message: received a command}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 if (LOWORD(uParam) == IDOK}{\f7\fs18 \tab }{\i\fs18\cf2 // "OK" box selected?}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 || LOWORD(uParam) == IDCANCEL) }{\f7\fs18 \{}{\f7\fs18 \tab }{\i\fs18\cf2 // System menu close command?}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 EndDialog(hDlg, TRUE);}{\f7\fs18 \tab }{\i\fs18\cf2 // Exit the dialog}{\i\fs18\cf2 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 DeleteObject (hfontDlg);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab \tab }{\f7\fs18 return (TRUE);}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \tab \tab }{\f7\fs18 break;}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 \}}{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 return (FALSE);}{\f7\fs18 \tab }{\i\fs18\cf2 // Didn't process the message}{\i\fs18\cf2 -\par }{\f7\fs18 -\par }{\f7\fs18 \tab }{\f7\fs18 lParam;}{\f7\fs18 \tab }{\i\fs18\cf2 // This will prevent 'unused formal parameter' warnings}{\i\fs18\cf2 -\par }\pard \li120\tx450\tx720\tx990\tx1260\tx1530\tx1800\tx2070\tx2340\tx2610\tx2880 {\f7\fs18 \}}{\f2\fs18 +\par }\pard \fi-504\li624 {\f2 1.}{\f2 \tab }{\f2 Open up this document.}{\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 2.}{\f2 \tab }{\f2 Turn on the 'View | Field Codes' option from the menu bar.}{\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 3.}{\f2 \tab }{\f2 Either remove, or appropriately alter the "}{\f2 \{}{\f2 bmc generic.bmp}{\f2 \}}{\f2 " field on the first line. Do not make any modifications to the "$ # K" that preceeds it.}{\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 4.}{\f2 \tab }{\f2 Create a new document and enter into it all of the information you are wanting to have in the WinHelp file. Avoid 'hard' pagebreaks (), and 'fancy' formatting.}{\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 5.}{\f2 \tab }{\f2 Change the "}{\f2 \{}{\f2 include GENERIC.DOC}{\f2 \}}{\f2 " field to point to your new document}{\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 6.}{\f2 \tab }{\f2 +Hilite the entire 'include' field that you just altered, and hit F9 (this will grab the information out of your document). If you run into problems with this step, simply delete the entire 'include' field, and copy/paste in the document you had created.}{ +\f2 +\par }\pard \li120 {\f2 +\par }\pard \fi-504\li624 {\f2 7.}{\f2 \tab }{\f2 Save this document out, but make sure that you save it out as an RTF file, and not a DOC file. The Help Compiler reads the RTF format for building WinHelp files.}{\f2 +\par }\pard \fi-1320\li1440 {\f2 \page }{\f2 \par }} \ No newline at end of file