home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / DLLSKEL.PAK / GLOBALS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  6.2 KB  |  175 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. #define APPNAME       AppSkel
  16. #define ICONFILE      APPSKEL.ICO
  17. #define SZAPPNAME     "AppSkel"
  18. #define SZDESCRIPTION "DLL and Application Skeleton"
  19. #define SZABOUT       "About AppSkel"
  20. #define SZVERSION     "Version 4.0"
  21.  
  22.  
  23. //-------------------------------------------------------------------------
  24. // Functions for handling main window messages.  The message-dispatching
  25. // mechanism expects all message-handling functions to have the following
  26. // prototype:
  27. //
  28. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  29.  
  30. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  31. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  32.  
  33.  
  34. //-------------------------------------------------------------------------
  35. // Functions for handling main window commands--ie. functions for
  36. // processing WM_COMMAND messages based on the wParam value.
  37. // The message-dispatching mechanism expects all command-handling
  38. // functions to have the following prototype:
  39. //
  40. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  41.  
  42. LRESULT CmdExit(HWND, WORD, WORD, HWND);
  43. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  44. LRESULT CmdDLLFunc1(HWND, WORD, WORD, HWND);
  45. LRESULT CmdDLLFunc2(HWND, WORD, WORD, HWND);
  46.  
  47.  
  48. //-------------------------------------------------------------------------
  49. // Global function prototypes.
  50.  
  51. BOOL InitApplication(HINSTANCE, int);
  52. BOOL CenterWindow(HWND, HWND);
  53.  
  54.     // Callback functions.  These are called by Windows.
  55. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  56.  
  57.  
  58. //-------------------------------------------------------------------------
  59. // Command ID definitions.  These definitions are used to associate menu
  60. // items with commands.
  61.  
  62. // File menu
  63. #define IDM_DLLFUNC1 1000
  64. #define IDM_DLLFUNC2 1001
  65. #define IDM_EXIT     1002
  66.  
  67. // Help menu
  68. #define IDM_ABOUT   1100
  69.  
  70. //-------------------------------------------------------------------------
  71. // String Table ID definitions.
  72.  
  73. #define IDS_APPNAME     1
  74. #define IDS_DESCRIPTION 2
  75.  
  76. //-------------------------------------------------------------------------
  77. //  About dialog defines.
  78.  
  79. #define IDD_VERFIRST    100
  80. #define IDD_VERLAST     104
  81.  
  82.  
  83. //-------------------------------------------------------------------------
  84. // Global variable declarations.
  85.  
  86. extern HINSTANCE hInst;          // The current instance handle
  87.  
  88. #define hwndMDIClient NULL        /* Stub for NON-MDI applications. */
  89.  
  90.  
  91. //-------------------------------------------------------------------------
  92. // Message and command dispatch infrastructure.  The following type
  93. // definitions and functions are used by the message and command dispatching
  94. // mechanism and do not need to be changed.
  95.  
  96.     // Function pointer prototype for message handling functions.
  97. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  98.  
  99.     // Function pointer prototype for command handling functions.
  100. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  101.  
  102.     // Enumerated type used to determine which default window procedure
  103.     // should be called by the message- and command-dispatching mechanism
  104.     // if a message or command is not handled explicitly.
  105. typedef enum
  106. {
  107.    edwpNone,            // Do not call any default procedure.
  108.    edwpWindow,          // Call DefWindowProc.
  109.    edwpDialog,          // Call DefDlgProc (This should be used only for
  110.                         // custom dialogs - standard dialog use edwpNone).
  111.    edwpMDIChild,        // Call DefMDIChildProc.
  112.    edwpMDIFrame         // Call DefFrameProc.
  113. } EDWP;                // Enumeration for Default Window Procedures
  114.  
  115.     // This structure maps messages to message handling functions.
  116. typedef struct _MSD
  117. {
  118.     UINT   uMessage;
  119.     PFNMSG pfnmsg;
  120. } MSD;                 // MeSsage Dispatch structure
  121.  
  122.     // This structure contains all of the information that a window
  123.     // procedure passes to DispMessage in order to define the message
  124.     // dispatching behavior for the window.
  125. typedef struct _MSDI
  126. {
  127.     int  cmsd;          // Number of message dispatch structs in rgmsd
  128.     MSD *rgmsd;         // Table of message dispatch structures
  129.     EDWP edwp;          // Type of default window handler needed.
  130. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  131.  
  132.     // This structure maps command IDs to command handling functions.
  133. typedef struct _CMD
  134. {
  135.     WORD   wCommand;
  136.     PFNCMD pfncmd;
  137. } CMD;                 // CoMmand Dispatch structure
  138.  
  139.     // This structure contains all of the information that a command
  140.     // message procedure passes to DispCommand in order to define the
  141.     // command dispatching behavior for the window.
  142. typedef struct _CMDI
  143. {
  144.     int  ccmd;          // Number of command dispatch structs in rgcmd
  145.     CMD *rgcmd;         // Table of command dispatch structures
  146.     EDWP edwp;          // Type of default window handler needed.
  147. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  148.  
  149.     // Message and command dispatching functions.  They look up messages
  150.     // and commands in the dispatch tables and call the appropriate handler
  151.     // function.
  152. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  153. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  154.  
  155.     // Message dispatch information for the main window
  156. extern MSDI msdiMain;
  157.     // Command dispatch information for the main window
  158. extern CMDI cmdiMain;
  159.  
  160.  
  161.  
  162. //-------------------------------------------------------------------------
  163. // Version string definitions--Leave these alone.
  164.  
  165. #define SZRCOMPANYNAME "CompanyName"
  166. #define SZRDESCRIPTION "FileDescription"
  167. #define SZRVERSION     "FileVersion"
  168. #define SZRAPPNAME     "InternalName"
  169. #define SZRCOPYRIGHT   "LegalCopyright"
  170. #define SZRTRADEMARK   "LegalTrademarks"
  171. #define SZRPRODNAME    "ProductName"
  172. #define SZRPRODVER     "ProuctVersion"
  173.  
  174.  
  175.