home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / w3_apps / ucb.arj / WINDOWS < prev   
Encoding:
Text File  |  1990-12-15  |  25.4 KB  |  844 lines

  1. \comment       Windows 3.0 Application Script (Version 1.01)
  2. \comment                      
  3. \comment       (C) Copyright DEA Software 1990  All Rights Reserved
  4. \comment 
  5. \comment 
  6. \nfill
  7. \npcontrol
  8. \comment 
  9. \comment       This Script creates a MS Windows 3.0 Application 
  10. \comment 
  11. \comment 
  12. \comment       @[1,1] = Name of Application
  13. \comment       @[2,1] = Caption string
  14. \comment       @[2,2] = the character Period "."
  15. \comment
  16. \comment       @[10,1] = Number of Menu items
  17. \comment       @[10,2] = Contains the name of the Menu (NULL or App Name)
  18. \comment       @[1,3] = Number of Child windows
  19. \comment         @[3,1] = Name of child window 1
  20. \comment         @[3,2] = Name of child window 2
  21. \comment          ...
  22. \comment       @[1,4] = 0 == No incon,       1 == Yes icon
  23. \comment         @[1,40] == Name of icon file
  24. \comment 
  25. \comment       @[1,5] = 0 == No cursor,      1 == Yes cursor
  26. \comment         @[1,50] == Cursor number
  27. \comment         @[2,50] == Name of Cursor ID
  28. \comment 
  29. \comment       @[1,63] = 0 == Use default size and location, 1 == use users 
  30. \comment         @[1,64] = x start loc
  31. \comment         @[1,65] = y start loc
  32. \comment         @[1,66] = x size
  33. \comment         @[1,67] = y size
  34. \comment  
  35. \comment       @[1,7] = 0 == No Vert scroll,  1 == Yes Vert scroll
  36. \comment       @[1,8] = 0 == No Hort scroll,  1 == Yes Hort scroll
  37. \comment       @[1,9] = 0 == No System Menu,  1 == Yes System Menu
  38. \comment       @[1,10] = 0 == No Maximize box, 1 == Yes Maximize box
  39. \comment       @[1,11] = 0 == No Minimize box, 1 == Yes Minimize box
  40. \comment
  41. \comment       @[1,12] = 0 == No Background color, 1 == Yes Background color
  42. \comment         @[1,62] = Background color #
  43. \comment         @[2,62] = Background color Text
  44. \comment
  45. \comment       @[1,17] = 0 == No Mouse proc,   1 == Yes Mouse proc
  46. \comment       @[1,18] = 0 == No Char proc ,  1 == Yes Char proc
  47. \comment       @[1,19] = 0 == No Timer proc,  1 == Yes Timer proc
  48. \comment 
  49. \comment       @[1,20] = 0 == small memory , 1 == medium memory
  50. \comment 
  51. \comment       @[4,1] = Total number of Dialog boxes
  52. \comment         @[4,2] = Temp loop counter
  53. \comment         @[4,3] = Total number of Modeless Dialog boxes
  54. \comment         @[4,10] ... @[4,n] = Dialog Box names
  55. \comment         @[5,10] ... @[5,n] = 1 == Modal, 2 == Modeless
  56. \comment
  57. \comment       @[11,1] = Name of main menu item 1
  58. \comment         @[11,2] = 0 = user code, 1 = modal, 2 = modeless 
  59. \comment         @[11,3] = name of called dialog box
  60. \comment       @[11,10] = Number of sub menu items
  61. \comment         @[11,11] = name of menu 1 sub menu 1
  62. \comment           @[11,111] = 0 = user code, 1 = modal, 2 = modeless 
  63. \comment           @[11,211] = name of called dialog box
  64. \comment         @[11,12] = name of menu 1 sub menu 2
  65. \comment         @[11,13] = name of menu 1 sub menu 3
  66. \comment         @[11,14] = name of menu 1 sub menu 4
  67. \comment         @[11,15] = name of menu 1 sub menu 5
  68. \comment             ...
  69. \comment 
  70. \comment       @[12,1] = Name of main menu item 2
  71. \comment       @[12,10] = Number of sub menu items
  72. \comment         @[12,11] = name of menu 2 sub menu 1
  73. \comment         @[12,12] = name of menu 2 sub menu 2
  74. \comment         @[12,13] = name of menu 2 sub menu 3
  75. \comment         @[12,14] = name of menu 2 sub menu 4
  76. \comment         @[12,15] = name of menu 2 sub menu 5
  77. \comment             ...
  78. \comment 
  79. \comment       @[13,1] = Name of main menu item 3
  80. \comment       @[14,1] = Name of main menu item 4
  81. \comment       @[15,1] = Name of main menu item 5
  82. \comment       @[16,1] = Name of main menu item 6
  83. \comment          ...
  84. \comment 
  85. \equ @[4,1] = 0
  86. \equ @[4,2] = 0
  87. \equ @[4,3] = 0
  88. \equ @[2,2] = '.
  89. \equ @[10,2] = 'NULL
  90. \wrline
  91. \wrline Windows 3.0 Application Generator (Version 1.00)
  92. \wrline
  93. \wrline       (C) Copyright DEA Software 1990
  94. \wrline
  95. \wrline On questions that ask for a "1" for a positive response you
  96. \wrline can reply negatively with a "0" response.
  97. \wrline 
  98. \rdtext @[1,1]  : Enter Name of Window program (Max 8 chars)
  99. \rdtext @[2,1]  : Enter Window Caption string
  100. \rdnum  @[1,4] # 0, 1 : Enter a 1 if you have an Icon file             :
  101. \comment load default Icon file name
  102. \equ @[1,40] = '
  103. \equ @[1,40] = @[1,1]
  104. \if @[1,4] = 1
  105. \rdtext @[1,40] : Enter Name of Icon file
  106. \rdnum  @[1,5] # 0, 1 : Enter a 1 if to select a Cursor                :
  107. \comment load default cursor id
  108. \equ @[2,50] = 'IDC_ARROW
  109. \if @[1,5] <> 1
  110. \skip 1
  111. \wrline    Standard Cursors
  112. \wrline    0 == IDC_ARROW,  1 == IDC_IBEAM,    2 == IDC_WAIT
  113. \wrline    3 == IDC_CROSS,  4 == IDC_UPARROW,  5 == IDC_SIZE
  114. \wrline    6 == IDC_ICON,   
  115. \rdnum @[1,50] # 0, 6 : Enter you cursor selection (0-6)                 :
  116. \if @[1,50] = 0
  117. \equ @[2,50] = 'IDC_ARROW
  118. \if @[1,50] = 1
  119. \equ @[2,50] = 'IDC_IBEAM
  120. \if @[1,50] = 2
  121. \equ @[2,50] = 'IDC_WAIT
  122. \if @[1,50] = 3
  123. \equ @[2,50] = 'IDC_CROSS
  124. \if @[1,50] = 4
  125. \equ @[2,50] = 'IDC_UPARROW
  126. \if @[1,50] = 5
  127. \equ @[2,50] = 'IDC_SIZE
  128. \if @[1,50] = 6
  129. \equ @[2,50] = 'IDC_ICON
  130. \eskip 1
  131. \rdnum @[1,63] # 0, 1 : Enter a 1 if you wish to set Window position   :
  132. \if @[1,63] = 1
  133. \rdnum @[1,64]  : Enter initial x position                       :
  134. \if @[1,63] = 1
  135. \rdnum @[1,65]  : Enter initial y position                       :
  136. \if @[1,63] = 1
  137. \rdnum @[1,66]  : Enter initial x size                           :
  138. \if @[1,63] = 1
  139. \rdnum @[1,67]  : Enter initial y size                           :
  140. \rdnum @[1,7] # 0, 1  : Enter a 1 if you want Vertical scroll bars     :
  141. \rdnum @[1,8] # 0, 1  : Enter a 1 if you want Hort scroll bars         :
  142. \rdnum @[1,9] # 0, 1  : Enter a 1 if you want System Menu              :
  143. \rdnum @[1,10] # 0, 1 : Enter a 1 if you want Maximize box             :
  144. \rdnum @[1,11] # 0, 1 : Enter a 1 if you want Minimize box             :
  145. \rdnum @[1,12] # 0, 1 : Enter a 1 if you want to set Background color  :
  146. \comment load default background brush
  147. \equ @[2,62] = 'WHITE_BRUSH
  148. \if @[1,12] <> 1   :  Skip if user does not want to set background color
  149. \skip 1
  150. \wrline    Background Brush Colors
  151. \wrline    0 == WHITE_BRUSH,  1 == LTGRAY_BRUSH, 2 == GRAY_BRUSH
  152. \wrline    3 == DKGRAY_BRUSH, 4 == BLACK_BRUSH,  5 == NULL_BRUSH
  153. \rdnum @[1,62] # 0, 5 : Enter you brush selection (0-5)                 :
  154. \if @[1,62] = 0
  155. \equ @[2,62] = 'WHITE_BRUSH
  156. \if @[1,62] = 1
  157. \equ @[2,62] = 'LTGRAY_BRUSH
  158. \if @[1,62] = 2
  159. \equ @[2,62] = 'GRAY_BRUSH
  160. \if @[1,62] = 3
  161. \equ @[2,62] = 'DKGRAY_BRUSH
  162. \if @[1,62] = 4
  163. \equ @[2,62] = 'BLACK_BRUSH
  164. \if @[1,62] = 5
  165. \equ @[2,62] = 'NULL_BRUSH
  166. \eskip 1
  167. \rdnum @[1,20] # 0, 1 : Enter a 1 for Medium Model, or 0 if Small Model :
  168. \rdnum @[1,17] # 0, 1 : Enter a 1 if you want a Mouse support           :
  169. \rdnum @[1,18] # 0, 1 : Enter a 1 if you want a Character input support :
  170. \rdnum @[1,19] # 0, 1 : Enter a 1 if you want a Timer procedure         :
  171. \comment
  172. \comment Collect Menu items
  173. \comment
  174. \wrline  *************************************************************
  175. \wrline  * Section to design the pulldown menus for your application *
  176. \wrline  *************************************************************
  177. \equ @[2,3] = 11
  178. \equ @[2,4] = 1
  179. \rdnum  @[10,1] : Enter Number of Main Menu Items                 :
  180. \if @[10,1] > 0
  181. \loop @[10,1] menuitem.000
  182. \if @[10,1] > 0
  183. \equ @[10,2] = @[1,1]   : Since we have menu items set Menu name to App name
  184. \comment \rdnum  @[1,3] : Enter Number of Child Windows
  185. \comment \loop @[1,3] childwin.000
  186. \comment
  187. \comment This is where we generate the Windows source code
  188. \comment
  189. \comment output skeleton.h file
  190. \comment
  191. \output @[1,1]@[2,2]h
  192. /* --------------------------------------------- */
  193. /* MODIFY these defines to fit your Dialog Boxes */
  194. /* --------------------------------------------- */
  195. #define ID_OK      1
  196. #define ID_CANCEL  2
  197. \mask   @[2,3]..@[2,7] = #####
  198. \npad   @[2,3]..@[2,7]
  199. \equ @[2,3] = 1     : Starting Main Menu number
  200. \equ @[2,4] = 100   : Starting Main Menu IDM # defines
  201. \equ @[2,5] = 11    : Starting Sub Menu starting index 
  202. \if @[10,1] > 0
  203. \loop @[10,1] menuitem.001
  204. \comment
  205. \comment skeleton.rc
  206. \comment
  207. \output @[1,1]@[2,2]rc
  208. #include <windows.h>
  209. #include "@[1,1]@[2,2]h"
  210. \space
  211. \if @[1,4] = 0
  212. \skip 1
  213. @[1,40] ICON @[1,40]@[2,2]ICO
  214. \eskip 1
  215. @[1,1] MENU
  216. \space
  217. BEGIN
  218. \equ @[2,3] = 1     : Starting Main Menu number
  219. \equ @[2,4] = 100   : Starting Main Menu IDM # defines
  220. \equ @[2,5] = 11    : Starting Sub Menu starting index 
  221. \if @[10,1] > 0
  222. \loop @[10,1] menuitem.002
  223. END
  224. \comment declare all the Dialog Box Procedures
  225. \equ @[4,2] = 0
  226. \if @[4,1] > 0
  227. \loop @[4,1] dialog.002
  228. \comment
  229. \comment skeleton.def
  230. \comment
  231. \output @[1,1]@[2,2]def
  232. \equ @[2,15] = '@
  233. \equ @[2,3] = 1
  234. NAME       @[1,1]
  235.  
  236. EXETYPE    WINDOWS
  237.  
  238. STUB       'WINSTUB.EXE'
  239.  
  240. CODE       PRELOAD MOVEABLE DISCARDABLE
  241. DATA       PRELOAD MOVEABLE MULTIPLE
  242.  
  243. HEAPSIZE   4096
  244. STACKSIZE  5120
  245.  
  246. ; All functions that will be called by any Windows routine
  247. ; MUST be exported.
  248.  
  249. EXPORTS
  250.            @[1,1]WindowProc   @[2,15]@[2,3]
  251. \comment Export all the Dialog Box Procedures
  252. \equ @[4,2] = 0
  253. \if @[4,1] > 0
  254. \loop @[4,1] dialog.000
  255. \comment
  256. \comment skeleton make file
  257. \comment
  258. \output @[1,1]@[2,2]
  259. \if @[1,20] <> 0   : Small Memory Model
  260. \skip 1
  261. all: @[1,1]@[2,2]exe
  262.  
  263. @[1,1]@[2,2]res : @[1,1]@[2,2]rc
  264.   rc -r @[1,1]@[2,2]rc                                      
  265.  
  266. @[1,1]@[2,2]obj : @[1,1]@[2,2]c @[1,1]@[2,2]h
  267.   cl -c -AS -Gsw -Oas -Zpe @[1,1]@[2,2]c
  268.  
  269. @[1,1]@[2,2]exe : @[1,1]@[2,2]obj @[1,1]@[2,2]res @[1,1]@[2,2]def
  270.   link /NOD @[1,1]@[2,2]obj, @[1,1], @[1,1]/map,libw slibcew,@[1,1]@[2,2]def
  271.   mapsym @[1,1]
  272.   rc @[1,1]@[2,2].res
  273. \eskip 1
  274. \if @[1,20] = 0 : Medium Memory Model
  275. \skip 1
  276. all: @[1,1]@[2,2]exe
  277.  
  278. @[1,1]@[2,2]res : @[1,1]@[2,2]rc
  279.   rc -r @[1,1]@[2,2]rc                                      
  280.  
  281. @[1,1]@[2,2]obj : @[1,1]@[2,2]c @[1,1]@[2,2]h
  282.   cl -c -AM -Gsw -Oas -Zpe @[1,1]@[2,2]c
  283.  
  284. @[1,1]@[2,2]exe : @[1,1]@[2,2]obj @[1,1]@[2,2]res @[1,1]@[2,2]def
  285.   link /NOD @[1,1]@[2,2]obj, @[1,1], @[1,1]/map,libw mlibcew,@[1,1]@[2,2]def
  286.   mapsym @[1,1]
  287.   rc @[1,1]@[2,2].res
  288. \eskip 1
  289. \comment
  290. \comment skeleton.c
  291. \comment
  292. \output @[1,1]@[2,2]c
  293. /***************************************************************/
  294. /*                      @[1,1]                              */
  295. /***************************************************************/
  296.  
  297. #include "Windows.h"
  298. #include "@[1,1]@[2,2]h"
  299.  
  300. /********************************************************************/
  301. /*     E X T E R N A L   V A R I A B L E S                          */
  302. /********************************************************************/
  303.  
  304. /* User data to be passed from first instance to other instances */
  305. typedef struct 
  306.   {                
  307.     int  dummy;    
  308.   } SETUPDATA;
  309.  
  310. SETUPDATA   SetUpData;
  311.  
  312. HANDLE  hInst;             /*  Data that can be referenced          */
  313.                            /*    throughout the program, but is not */
  314.                            /*    normally passed to other instances.*/
  315.  
  316. /********************************************************************/
  317. /*            F O R W A R D   R E F E R E N C E S                   */
  318. /********************************************************************/
  319.  
  320. void Init@[1,1] (HANDLE, HANDLE, int);
  321. void Init@[1,1]First (HANDLE);
  322. void Init@[1,1]Added (HANDLE, HANDLE);
  323. void Init@[1,1]Every (HANDLE, int);
  324. void Close@[1,1] (HANDLE);
  325. void Paint@[1,1]Window (HWND);
  326. \if @[1,17] = 0
  327. \skip 1
  328. void @[1,1]TrackMouseProc (HWND, unsigned, POINT);
  329. \eskip 1
  330. \if @[1,7] = 0
  331. \skip 1
  332. void @[1,1]VertScrollProc (HWND, WORD);
  333. \eskip 1
  334. \if @[1,8] = 0
  335. \skip 1
  336. void @[1,1]HorizScrollProc (HWND, WORD);
  337. \eskip 1
  338. \comment declare all the Dialog Box Procedures
  339. \equ @[4,2] = 0
  340. \if @[4,1] > 0
  341. \loop @[4,1] dialog.001
  342.  
  343. long FAR PASCAL @[1,1]WindowProc (HWND, unsigned, WORD, LONG);
  344.  
  345. /********************************************************************/
  346. /*                 G L O B A L   V A R I A B L E S                  */
  347. /********************************************************************/
  348.  
  349. char szAppName [] = "@[1,1]";
  350. HWND  ghWnd;         /*  Global Handle to the Window        */
  351. \if @[4,3] = 0
  352. \skip 1
  353.  
  354. /* This code supports only ONE Modeless dialog box at a time   */
  355. /* in order to start another Modeless dialog box you must stop */
  356. /* the current one.  Use DestroyWindow function to terminate a */
  357. /* Modeless dialog box.                                        */
  358.  
  359. HWND hDlgModeless;  /* Handle to a Modeless dialog box   */    
  360. \eskip 1
  361.  
  362.  
  363. /********************************************************************/
  364. /*                    M A I N   P R O C E D U R E                   */
  365. /********************************************************************/
  366.  
  367. int PASCAL WinMain (hInstance, hPrevInstance, lpszCmdLine, cmdShow)
  368.  
  369. HANDLE hInstance;
  370. HANDLE hPrevInstance;
  371. LPSTR  lpszCmdLine;    /*  Command line                     */
  372. int    cmdShow;        /*  Window open or iconic at start   */
  373.  
  374. {
  375.    MSG   msg;          /*  Temp buffer to hold message      */
  376.    HANDLE hAccel;      /*  Handle to the accelerator table  */
  377.  
  378.    /*  Initialization routine */
  379.    Init@[1,1] (hInstance, hPrevInstance, cmdShow);
  380. \if @[4,3] = 0
  381. \skip 1
  382.  
  383.    /* This code supports only ONE Modeless dialog box at a time   */
  384.    /* in order to start another Modeless dialog box you must stop */
  385.    /* the current one.  Use DestroyWindow function to terminate a */
  386.    /* Modeless dialog box.                                        */
  387.  
  388.    hDlgModeless = NULL;    
  389. \eskip 1
  390.  
  391.    hAccel = LoadAccelerators (hInstance, szAppName);
  392.  
  393.    /*  main window loop       */
  394.    while (GetMessage(&msg, NULL, 0, 0))  /*  Terminated by quit msg */
  395.      {
  396. \if @[4,3] = 0
  397. \skip 1
  398.      if (hDlgModeless == NULL || !IsDialogMessage (hDlgModeless, &msg))
  399.        {
  400. \eskip 1
  401.        if (!TranslateAccelerator (ghWnd, hAccel, &msg))
  402.          {
  403.            TranslateMessage(&msg);     /*  Translate virtual keys   */
  404.            DispatchMessage(&msg);      /*  Have Windows give msg    */
  405.          }                             /*    to the window proc     */ 
  406. \if @[4,3] = 0
  407. \skip 1
  408.        }
  409. \eskip 1
  410.      }
  411.  
  412.    /*  Closing routine        */ 
  413.    Close@[1,1] (hInstance);   
  414.  
  415.    return (msg.wParam);
  416.  
  417. } /* WinMain END */
  418.  
  419.  
  420. /********************************************************************/
  421. /*                I N I T I A L I Z A T I O N                       */
  422. /********************************************************************/
  423.  
  424. void Init@[1,1] (hInstance, hPrevInstance, cmdShow)
  425.  
  426. HANDLE hInstance, hPrevInstance;
  427. int    cmdShow;
  428. {
  429.   if (!hPrevInstance)
  430.     /*  Initialize first instance  only */
  431.     Init@[1,1]First (hInstance);
  432.   else
  433.     /* Initialize additional instances  */
  434.     Init@[1,1]Added (hInstance, hPrevInstance);
  435.  
  436.   /*  Initialize all instances.         */
  437.   Init@[1,1]Every (hInstance, cmdShow); 
  438.  
  439. } /* Init@[1,1] END */
  440.  
  441.  
  442. /********************************************************************/
  443. /*    F I R S T - I N S T A N C E   I N I T I A L I Z A T I O N     */
  444. /********************************************************************/
  445.  
  446. /*   Done only once, regardless of the number of instances running  */
  447. /*   Register the window class(es).                                 */
  448. /*   Create the objects, bitmaps, and metafiles that are to be used */
  449. /*   by all instances of this application.                          */
  450.  
  451. void Init@[1,1]First (hInstance)
  452.  
  453. HANDLE hInstance;
  454. {
  455.   WNDCLASS   wc@[1,1]Class;
  456.  
  457.   /*  Fill it with window class information.  */
  458.   wc@[1,1]Class.lpszClassName = "@[1,1]";
  459.   wc@[1,1]Class.hInstance     = hInstance;
  460.   wc@[1,1]Class.lpfnWndProc   = @[1,1]WindowProc;
  461.   wc@[1,1]Class.hCursor       = LoadCursor (NULL, @[2,50]);
  462.   wc@[1,1]Class.hIcon         = LoadIcon (hInstance, "@[1,40]");
  463. \if @[10,1] = 0
  464. \skip 1    : if no Menu items then do not load a menu
  465.   wc@[1,1]Class.lpszMenuName  = "@[10,2]";
  466. \eskip 1
  467. \if @[10,1] > 0
  468. \skip 1
  469.   wc@[1,1]Class.lpszMenuName  = NULL;
  470. \eskip 1
  471.   wc@[1,1]Class.hbrBackground = GetStockObject (@[2,62]);
  472.   wc@[1,1]Class.style         = CS_HREDRAW | CS_VREDRAW;
  473.   wc@[1,1]Class.cbClsExtra    = 0;
  474.   wc@[1,1]Class.cbWndExtra    = 0;
  475.  
  476.   /*  Register the class.     */
  477.   RegisterClass (&wc@[1,1]Class);
  478.  
  479. } /* Init@[1,1]First END */
  480.  
  481.  
  482. /********************************************************************/
  483. /*  A D D E D - I N S T A N C E   I N I T I A L I Z A T I O N       */
  484. /********************************************************************/
  485.  
  486. /*   Done for every instance other than the first.                  */
  487. /*   Copy the results of the previous instance's initialization     */
  488.  
  489. void Init@[1,1]Added (hInstance, hPrevInstance)
  490.  
  491. HANDLE hInstance, hPrevInstance;
  492. {
  493.   /*  Get the results of the previous initialization.*/
  494.   GetInstanceData (hPrevInstance, (PSTR)&SetUpData, sizeof(SETUPDATA));
  495.  
  496. } /* Init@[1,1]Added END */
  497.  
  498.  
  499. /*********************************************************************/
  500. /*  E V E R Y - I N S T A N C E   I N I T I A L I Z A T I O N        */
  501. /*********************************************************************/
  502.  
  503. /*   Done once for each instance of the application.                 */
  504. /*   Create the window. (Cause an instance of the window to exist)   */
  505. /*   Show the window.   (Cause the window to be drawn on the screen) */
  506. /*   Update the window. (Cause your paint procedure to be executed)  */
  507.  
  508. void Init@[1,1]Every (hInstance, cmdShow)
  509.  
  510. HANDLE hInstance;
  511. int    cmdShow;
  512. {
  513.  
  514.   /*  Save the hInstance so that your window procs can use it */
  515.   hInst = hInstance;               
  516.  
  517.   ghWnd = CreateWindow(
  518.                 "@[1,1]",             /*  Window class name.       */
  519.                 "@[2,1]",             /*  Window title.            */
  520. \if @[1,7] <> 1  : Vert Scroll 
  521. \skip 1
  522.                 WS_VSCROLL |
  523. \eskip 1
  524. \if @[1,8] <> 1  : Hort Scroll 
  525. \skip 1
  526.                 WS_HSCROLL |
  527. \eskip 1
  528. \if @[1,9] <> 1  : System Menu 
  529. \skip 1
  530.                 WS_SYSMENU |
  531. \eskip 1
  532. \if @[1,10] <> 1  : Maximize box 
  533. \skip 1
  534.                 WS_MAXIMIZEBOX |
  535. \eskip 1
  536. \if @[1,11] <> 1  : Minimize box 
  537. \skip 1
  538.                 WS_MINIMIZEBOX |
  539. \eskip 1
  540.                 WS_OVERLAPPEDWINDOW ,   /*  Type of window.          */
  541. \if @[1,63] <> 0   : Use default location and size
  542. \skip 1
  543.                 CW_USEDEFAULT,          /*  x - default location.    */
  544.                 0,                      /*  y                        */
  545.                 CW_USEDEFAULT,          /*  cx - default size.       */
  546.                 0,                      /*  cy                       */
  547. \eskip 1
  548. \if @[1,63] <> 1  : Use user specified location and size
  549. \skip 1
  550. \mask @[1,64]..@[1,67] = ######
  551. \pad  @[1,64]..@[1.67]
  552.                 @[1,64],                /*  x -  location            */
  553.                 @[1,65],                /*  y                        */
  554.                 @[1,66],                /*  cx - size                */
  555.                 @[1,67],                /*  cy                       */
  556. \eskip 1
  557.                 NULL,                   /*  No parent for this wind. */
  558.                 NULL,                   /*  Use the class menu.      */
  559.                 hInstance,              /*  Who created this window. */
  560.                 NULL                    /*  No params to pass on.    */
  561.                );
  562.  
  563.   /*  Display this window on the screen. */
  564.   ShowWindow (ghWnd, cmdShow); 
  565.  
  566.   /*  Paint the client area.             */
  567.   UpdateWindow (ghWnd);    
  568.  
  569. } /* Init@[1,1]Every END */
  570.   
  571.  
  572. /*******************************************************************/
  573. /*                  C L O S I N G   R O U T I N E                  */
  574. /*******************************************************************/
  575.  
  576. void Close@[1,1] (hInstance)
  577.  
  578. HANDLE hInstance;
  579. {
  580. } /* Close@[1,1] END */
  581.  
  582. \if @[1,17] = 0
  583. \skip 1
  584.  
  585. /*******************************************************************/
  586. /*                  M O U S E   R O U T I N E                      */
  587. /*******************************************************************/
  588.  
  589. void @[1,1]TrackMouseProc (hWnd, message, Point)
  590.  
  591. HWND       hWnd;            /*  Handle of the window.        */
  592. unsigned   message;         /*  Message type.                */
  593. POINT      Point;           /*  Coordinates of mouse cursor. */
  594.  
  595. {
  596. switch (message)
  597.     {
  598.     case WM_MOUSEMOVE:
  599.         break;
  600.  
  601.     case WM_LBUTTONDOWN:
  602.         break;
  603.  
  604.     case WM_RBUTTONDOWN:
  605.         break;
  606.  
  607.     case WM_LBUTTONDBLCLK:
  608.         break;
  609.  
  610.     case WM_RBUTTONDBLCLK:
  611.         break;
  612.  
  613.     case WM_LBUTTONUP:
  614.         break;
  615.  
  616.     case WM_RBUTTONUP:
  617.         break;
  618.  
  619.     default:
  620.         return;
  621.     }
  622. } /* @[1,1]TrackMouseProc END */
  623. \eskip 1
  624.  
  625. \if @[1,7] = 0
  626. \skip 1
  627.  
  628. /*******************************************************************/
  629. /*      V E R T I C A L   S C R O L L   R O U T I N E              */
  630. /*******************************************************************/
  631.  
  632. void  @[1,1]VertScrollProc (hWnd, wParam)
  633.  
  634. HWND hWnd;
  635. WORD   wParam;
  636.  
  637. {
  638. /* --------------------------------------------------- */
  639. /* ADD your code here to process Vertical scrolling    */
  640. /* --------------------------------------------------- */
  641.  
  642.   switch (wParam)
  643.   {
  644.     case SB_TOP:
  645.          break ;
  646.  
  647.     case SB_BOTTOM:
  648.          break ;
  649.  
  650.     case SB_LINEUP:
  651.          break ;
  652.  
  653.     case SB_LINEDOWN:
  654.          break ;
  655.  
  656.     case SB_PAGEUP:
  657.          break ;
  658.  
  659.     case SB_PAGEDOWN:
  660.          break ;
  661.  
  662.     case SB_THUMBTRACK:
  663.          break ;
  664.  
  665.     default:
  666.          break;
  667.   }
  668.  
  669. } /* @[1,1]VertScrollProc END */
  670.  
  671. \eskip 1
  672. \if @[1,8] = 0
  673. \skip 1
  674.  
  675. /*******************************************************************/
  676. /*      H O R I Z O N T A L   S C R O L L   R O U T I N E          */
  677. /*******************************************************************/
  678.  
  679. void  @[1,1]HorizScrollProc (hWnd, wParam)
  680.  
  681. HWND hWnd;
  682. WORD   wParam;
  683.  
  684. {
  685.  
  686. /* --------------------------------------------------- */
  687. /* ADD your code here to process Horizontal scrolling  */
  688. /* --------------------------------------------------- */
  689.    switch (wParam)
  690.     {
  691.     case SB_LINEUP:
  692.          break ;
  693.  
  694.     case SB_LINEDOWN:
  695.          break ;
  696.  
  697.     case SB_PAGEUP:
  698.          break ;
  699.  
  700.     case SB_PAGEDOWN:
  701.          break ;
  702.  
  703.     case SB_THUMBPOSITION:
  704.          break ;
  705.  
  706.     default:
  707.          break;
  708.     }
  709.  
  710. } /* @[1,1]HorizScrollProc END */
  711.  
  712. \eskip 1
  713.  
  714. /*********************************************************************/
  715. /*                P A I N T    R O U T I N E                         */
  716. /*********************************************************************/
  717.  
  718. void Paint@[1,1]Window (hWnd)
  719.  
  720. HWND          hWnd;              /*  Handle of the window  */
  721. {
  722.   PAINTSTRUCT  ps;               /*  Used for painting     */
  723.   HDC          hDC;
  724.  
  725.   hDC = BeginPaint (hWnd, &ps);     
  726.  
  727. /* ------------------------------------------------------- */
  728. /*  ADD your paint code that outputs to the client area    */
  729. /* ------------------------------------------------------- */
  730.  
  731.   EndPaint (hWnd, &ps);
  732.  
  733. } /* Paint@[1,1]Window END */
  734.  
  735.  
  736. /*********************************************************************/
  737. /*              W I N D O W    P R O C E D U R E                     */
  738. /*********************************************************************/
  739.  
  740. long FAR PASCAL @[1,1]WindowProc (hWnd, message, wParam, lParam)
  741.  
  742. HWND       hWnd;          /*  Handle of the window. */
  743. unsigned   message;       /*  Message type.         */
  744. WORD       wParam;        /*  Message 16-bit param. */
  745. LONG       lParam;        /*  Message 32-bit param. */
  746. {
  747. \if @[4,1] = 0
  748. \skip 1
  749.   FARPROC lpfnDlgProc;
  750. \eskip 1
  751.  
  752.   switch (message)                        
  753.     {
  754. \if @[1,17] = 0
  755. \skip 1
  756.       case WM_MOUSEMOVE:
  757.       case WM_LBUTTONDOWN:
  758.       case WM_RBUTTONDOWN:
  759.       case WM_LBUTTONUP:
  760.       case WM_RBUTTONUP:
  761.       case WM_LBUTTONDBLCLK:
  762.       case WM_RBUTTONDBLCLK:
  763.          @[1,1]TrackMouseProc (hWnd, message, MAKEPOINT(lParam));
  764.          break;
  765. \eskip 1
  766.  
  767.       case WM_COMMAND:
  768.  
  769.          switch (wParam)
  770.            {
  771. \equ @[2,3] = 1     : Starting Main Menu number
  772. \equ @[2,4] = 100   : Starting Main Menu IDM # defines
  773. \equ @[2,5] = 11    : Starting Sub Menu starting index 
  774. \if @[10,1] > 0
  775. \loop @[10,1] menuitem.003
  776.            default :
  777.                break;
  778.            }
  779.          break;
  780.   
  781.       case WM_CREATE:
  782.          break;
  783.  
  784.       case WM_SIZE:
  785.          break;
  786.  
  787. \if @[1,7] = 0
  788. \skip 1
  789.       case WM_VSCROLL:
  790.  
  791.          /* Process Vertical scrolling */
  792.  
  793.          @[1,1]VertScrollProc (hWnd, wParam);
  794.          break;
  795.  
  796. \eskip 1
  797. \if @[1,8] = 0
  798. \skip 1
  799.       case WM_HSCROLL:
  800.  
  801.          /* Process Horizontal scrolling */
  802.  
  803.          @[1,1]HorizScrollProc (hWnd, wParam);
  804.          break;
  805.  
  806. \eskip 1
  807.       case WM_PAINT:                       
  808.  
  809.         /*  Redraw the client area */
  810.  
  811.         Paint@[1,1]Window (hWnd);       
  812.         break;
  813.  
  814.       case WM_DESTROY:            
  815.  
  816.         /* Destroy the Window      */
  817.  
  818.         PostQuitMessage(0); 
  819.         break;     
  820.  
  821.       default:                            
  822.           return(DefWindowProc(hWnd, message, wParam, lParam)); 
  823.           break; 
  824.     }
  825.   return(0L);
  826. }  /* @[1,1]WindowProc  END */
  827.  
  828. /*****************************************************************/
  829. /*          D I A L O G   B O X   R O U T I N E S                */
  830. /*****************************************************************/
  831.  
  832. \equ @[4,2] = 0
  833. \if @[4,1] > 0
  834. \loop @[4,1] dialog.003
  835. \wrline
  836. \wrline
  837. \wrline
  838. \wrline Windows 3.0 application generation completed
  839. \wrline
  840. \wrline
  841. \wrline
  842. \wrline
  843. \wrline
  844.