home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / INITREE.PAK / GLOBALS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  6.1 KB  |  156 lines

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (C) 1993-1995  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. // PURPOSE:
  9. //    Contains declarations for all globally scoped names in the program.
  10. //
  11.  
  12. //-------------------------------------------------------------------------
  13. // Product identifier string defines
  14.  
  15. //  **TODO** Change these strings to the name of your application.
  16.  
  17. #define APPNAME       INITree
  18. #define ICONFILE      INITREE.ICO
  19. #define SZAPPNAME     "INITree"
  20. #define SZDESCRIPTION "INITree Example Application"
  21. #define SZABOUT       "About INITree"
  22. #define SZVERSION     "Version 4.0"
  23.  
  24.  
  25. //-------------------------------------------------------------------------
  26. // Functions for handling main window messages.  The message-dispatching
  27. // mechanism expects all message-handling functions to have the following
  28. // prototype:
  29. //
  30. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  31.  
  32. // **TODO**  Add message-handling function prototypes here.  Be sure to
  33. //           add the function names to the main window message table in
  34. //           generic.c.
  35.  
  36. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  37. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  38. LRESULT MsgCreate(HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgSize(HWND, UINT, WPARAM, LPARAM);
  40.  
  41. //-------------------------------------------------------------------------
  42. // Functions for handling main window commands--ie. functions for
  43. // processing WM_COMMAND messages based on the wParam value.
  44. // The message-dispatching mechanism expects all command-handling
  45. // functions to have the following prototype:
  46. //
  47. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  48.  
  49. // **TODO**  Add message-handling function prototypes here.  Be sure to
  50. //           add the function names to the main window command table in
  51. //           generic.c.
  52.  
  53. LRESULT CmdExit(HWND, WORD, WORD, HWND);
  54. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  55. LRESULT CmdFill(HWND, WORD, WORD, HWND);
  56.  
  57.  
  58. //-------------------------------------------------------------------------
  59. // Global function prototypes.
  60.  
  61. // **TODO**  Add global function prototypes here.
  62.  
  63. BOOL InitApplication(HINSTANCE, int);
  64. BOOL CenterWindow(HWND, HWND);
  65.  
  66.     // Callback functions.  These are called by Windows.
  67.  
  68. // **TODO**  Add new callback function prototypes here.
  69.  
  70. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  71.  
  72.  
  73. //-------------------------------------------------------------------------
  74. // Global variable declarations.
  75.  
  76. extern HINSTANCE hInst;          // The current instance handle
  77. extern char      szAppName[];    // The name of this application
  78. extern char      szTitle[];      // The title bar text
  79.  
  80. // **TODO**  For NON-MDI applications, uncomment line 1 below and comment
  81. //           line 2.  For MDI applications, uncomment line 2 below, comment
  82. //           line 1, and then define hwndMDIClient as a global variable in
  83. //           INIT.C
  84. #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
  85. // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
  86.  
  87.  
  88. //-------------------------------------------------------------------------
  89. // Message and command dispatch infrastructure.  The following type
  90. // definitions and functions are used by the message and command dispatching
  91. // mechanism and do not need to be changed.
  92.  
  93.     // Function pointer prototype for message handling functions.
  94. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  95.  
  96.     // Function pointer prototype for command handling functions.
  97. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  98.  
  99.     // Enumerated type used to determine which default window procedure
  100.     // should be called by the message- and command-dispatching mechanism
  101.     // if a message or command is not handled explicitly.
  102. typedef enum
  103. {
  104.    edwpNone,            // Do not call any default procedure.
  105.    edwpWindow,          // Call DefWindowProc.
  106.    edwpDialog,          // Call DefDlgProc (This should be used only for
  107.                         // custom dialogs - standard dialog use edwpNone).
  108.    edwpMDIChild,        // Call DefMDIChildProc.
  109.    edwpMDIFrame         // Call DefFrameProc.
  110. } EDWP;                // Enumeration for Default Window Procedures
  111.  
  112.     // This structure maps messages to message handling functions.
  113. typedef struct _MSD
  114. {
  115.     UINT   uMessage;
  116.     PFNMSG pfnmsg;
  117. } MSD;                 // MeSsage Dispatch structure
  118.  
  119.     // This structure contains all of the information that a window
  120.     // procedure passes to DispMessage in order to define the message
  121.     // dispatching behavior for the window.
  122. typedef struct _MSDI
  123. {
  124.     int  cmsd;          // Number of message dispatch structs in rgmsd
  125.     MSD *rgmsd;         // Table of message dispatch structures
  126.     EDWP edwp;          // Type of default window handler needed.
  127. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  128.  
  129.     // This structure maps command IDs to command handling functions.
  130. typedef struct _CMD
  131. {
  132.     WORD   wCommand;
  133.     PFNCMD pfncmd;
  134. } CMD;                 // CoMmand Dispatch structure
  135.  
  136.     // This structure contains all of the information that a command
  137.     // message procedure passes to DispCommand in order to define the
  138.     // command dispatching behavior for the window.
  139. typedef struct _CMDI
  140. {
  141.     int  ccmd;          // Number of command dispatch structs in rgcmd
  142.     CMD *rgcmd;         // Table of command dispatch structures
  143.     EDWP edwp;          // Type of default window handler needed.
  144. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  145.  
  146.     // Message and command dispatching functions.  They look up messages
  147.     // and commands in the dispatch tables and call the appropriate handler
  148.     // function.
  149. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  150. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  151.  
  152.     // Message dispatch information for the main window
  153. extern MSDI msdiMain;
  154.     // Command dispatch information for the main window
  155. extern CMDI cmdiMain;
  156.