home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / ras / rasberry / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  8.5 KB  |  236 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-1997  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. // PURPOSE:
  9. //    Contains declarations for all globally scoped names in the program.
  10. //
  11.  
  12. #include <ras.h> // needed for HRASCONN structure
  13.  
  14. //-------------------------------------------------------------------------
  15. // Product identifier string defines
  16.  
  17. //  **TODO** Change these strings to the name of your application.
  18.  
  19. #define APPNAME       RASberry
  20. #define ICONFILE      RASberry.ico
  21. #define SZAPPNAME     "RASberry"
  22. #define SZDESCRIPTION "Remote Access Service Sample"
  23. #define SZABOUT       "About RASberry"
  24. #define SZVERSION     "Version 1.0"
  25.  
  26.  
  27. //-------------------------------------------------------------------------
  28. // Functions for handling main window messages.  The message-dispatching
  29. // mechanism expects all message-handling functions to have the following
  30. // prototype:
  31. //
  32. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  33.  
  34. // **TODO**  Add message-handling function prototypes here.  
  35. //           add the function names to the main window message table in
  36. //           rasberry.c.
  37.  
  38. LRESULT MsgCreate(HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgSetFocus(HWND, UINT, WPARAM, LPARAM);
  40. LRESULT MsgSize(HWND, UINT, WPARAM, LPARAM);
  41. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  42. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  43.  
  44.  
  45. //-------------------------------------------------------------------------
  46. // Functions for handling main window commands--ie. functions for
  47. // processing WM_COMMAND messages based on the wParam value.
  48. // The message-dispatching mechanism expects all command-handling
  49. // functions to have the following prototype:
  50. //
  51. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  52.  
  53. // **TODO**  Add message-handling function prototypes here.  Be sure to
  54. //           add the function names to the main window command table in
  55. //           rasberry.c.
  56.  
  57. LRESULT CmdPhbkDlg(HWND, WORD, WORD, HWND);
  58. LRESULT CmdStatDlg(HWND, WORD, WORD, HWND);
  59. LRESULT CmdHangUp(HWND, WORD, WORD, HWND);
  60. LRESULT CmdRefresh(HWND, WORD, WORD, HWND);
  61. LRESULT CmdConnNotify(HWND, WORD, WORD, HWND);
  62. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  63. LRESULT CmdExit(HWND, WORD, WORD, HWND);
  64.  
  65.  
  66. //-------------------------------------------------------------------------
  67. // Global function prototypes.
  68.  
  69. // **TODO**  Add global function prototypes here.
  70.  
  71. BOOL InitApplication(HINSTANCE);
  72. BOOL InitInstance(HINSTANCE, int);
  73. BOOL CenterWindow(HWND, HWND);
  74.  
  75.     // Callback functions.  These are called by Windows.
  76.  
  77. // **TODO**  Add new callback function prototypes here.  Win16 compiles
  78. //           require the __export keyword to generate proper prolog
  79. //           and epilog code for exported functions.
  80.  
  81. #ifdef WIN16
  82.  
  83. LRESULT CALLBACK __export WndProc(HWND, UINT, WPARAM, LPARAM);
  84.  
  85. #else
  86.  
  87. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  88.  
  89. #endif
  90.  
  91.  
  92. //-------------------------------------------------------------------------
  93. // Command ID definitions.  These definitions are used to associate menu
  94. // items with commands.
  95.  
  96. // **TODO**  Add IDs for all menu commands here.  Be sure that the IDs you
  97. //           add are also added to the main window command table in rasberry.c
  98. //           and the menu statements in the resource file.
  99.  
  100. // File menu
  101. #define IDM_EXIT         1000
  102. #define IDM_PHONEBOOK    1001
  103.  
  104. // Connection menu
  105. #define IDM_REFRESH      1100
  106. #define IDM_STATUS       1101
  107. #define IDM_HANGUP       1102
  108.  
  109. // Help menu
  110. #define IDM_ABOUT        1200
  111.  
  112. //-------------------------------------------------------------------------
  113. // String Table ID definitions.
  114.  
  115. #define IDS_APPNAME         1
  116. #define IDS_DESCRIPTION     2
  117. #define IDS_UNDEFINED_ERROR 3
  118.                                                 
  119. //-------------------------------------------------------------------------
  120. //  Main window defines.
  121.  
  122. #define IDL_CONN        100
  123. #define IDC_STATIC       -1
  124.                                                 
  125. //-------------------------------------------------------------------------
  126. //  About dialog defines.
  127.  
  128. #define IDD_VERFIRST    200
  129. #define IDD_VERLAST     204
  130.  
  131.  
  132.  
  133. //-------------------------------------------------------------------------
  134. // Global variable declarations.
  135.  
  136. extern HINSTANCE hInst;          // The current instance handle
  137. extern char      szAppName[];    // The name of this application
  138. extern char      szTitle[];      // The title bar text
  139.  
  140. extern char      g_szUserName[];
  141. extern char      g_szPassword[];
  142. extern char      g_szDomain[];
  143.  
  144. extern LPHRASCONN g_lphRasConn;
  145.  
  146. // **TODO**  For NON-MDI applications uncomment line 1 below and comment
  147. //           line 2.  For MDI applications, uncomment line 2 below, comment
  148. //           line 1, and then define hwndMDIClient as a global variable in
  149. //           INIT.C
  150. #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
  151. // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
  152.  
  153.  
  154. //-------------------------------------------------------------------------
  155. // Message and command dispatch infrastructure.  The following type
  156. // definitions and functions are used by the message and command dispatching
  157. // mechanism and do not need to be changed.
  158.  
  159.     // Function pointer prototype for message handling functions.
  160. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  161.  
  162.     // Function pointer prototype for command handling functions.
  163. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  164.  
  165.     // Enumerated type used to determine which default window procedure
  166.     // should be called by the message- and command-dispatching mechanism
  167.     // if a message or command is not handled explicitly.
  168. typedef enum
  169. {
  170.    edwpNone,            // Do not call any default procedure.
  171.    edwpWindow,          // Call DefWindowProc.
  172.    edwpDialog,          // Call DefDlgProc (This should be used only for
  173.                         // custom dialogs - standard dialog use edwpNone).
  174.    edwpMDIChild,        // Call DefMDIChildProc.
  175.    edwpMDIFrame         // Call DefFrameProc.
  176. } EDWP;                // Enumeration for Default Window Procedures
  177.  
  178.     // This structure maps messages to message handling functions.
  179. typedef struct _MSD
  180. {
  181.     UINT   uMessage;
  182.     PFNMSG pfnmsg;
  183. } MSD;                 // MeSsage Dispatch structure
  184.  
  185.     // This structure contains all of the information that a window
  186.     // procedure passes to DispMessage in order to define the message
  187.     // dispatching behavior for the window.
  188. typedef struct _MSDI
  189. {
  190.     int  cmsd;          // Number of message dispatch structs in rgmsd
  191.     MSD *rgmsd;         // Table of message dispatch structures
  192.     EDWP edwp;          // Type of default window handler needed.
  193. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  194.  
  195.     // This structure maps command IDs to command handling functions.
  196. typedef struct _CMD
  197. {
  198.     WORD   wCommand;
  199.     PFNCMD pfncmd;
  200. } CMD;                 // CoMmand Dispatch structure
  201.  
  202.     // This structure contains all of the information that a command
  203.     // message procedure passes to DispCommand in order to define the
  204.     // command dispatching behavior for the window.
  205. typedef struct _CMDI
  206. {
  207.     int  ccmd;          // Number of command dispatch structs in rgcmd
  208.     CMD *rgcmd;         // Table of command dispatch structures
  209.     EDWP edwp;          // Type of default window handler needed.
  210. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  211.  
  212.     // Message and command dispatching functions.  They look up messages
  213.     // and commands in the dispatch tables and call the appropriate handler
  214.     // function.
  215. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  216. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  217.  
  218.     // Message dispatch information for the main window
  219. extern MSDI msdiMain;
  220.     // Command dispatch information for the main window
  221. extern CMDI cmdiMain;
  222.  
  223.  
  224.  
  225. //-------------------------------------------------------------------------
  226. // Version string definitions--Leave these alone.
  227.  
  228. #define SZRCOMPANYNAME "CompanyName"
  229. #define SZRDESCRIPTION "FileDescription"
  230. #define SZRVERSION     "FileVersion"
  231. #define SZRAPPNAME     "InternalName"
  232. #define SZRCOPYRIGHT   "LegalCopyright"
  233. #define SZRTRADEMARK   "LegalTrademarks"
  234. #define SZRPRODNAME    "ProductName"
  235. #define SZRPRODVER     "ProuctVersion"
  236.