home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / PVIEW95.PAK / GLOBALS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  6.0 KB  |  151 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       PView95
  16. //#define SZAPPNAME     "PView95"
  17. //#define SZDESCRIPTION "Process Viewer Application"
  18. //#define SZABOUT       "About PView95"
  19. //#define SZVERSION     "Version 4.0"
  20.  
  21.  
  22. //-------------------------------------------------------------------------
  23. // Functions for handling main window messages.  The message-dispatching
  24. // mechanism expects all message-handling functions to have the following
  25. // prototype:
  26. //
  27. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  28.  
  29. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  30. LRESULT MsgPaint(HWND, UINT, WPARAM, LPARAM);
  31. LRESULT MsgSize(HWND, UINT, WPARAM, LPARAM);
  32. LRESULT MsgLButtonDown(HWND, UINT, WPARAM, LPARAM);
  33. LRESULT MsgLButtonUp(HWND, UINT, WPARAM, LPARAM);
  34. LRESULT MsgMouseMove(HWND, UINT, WPARAM, LPARAM);
  35. LRESULT MsgNotify(HWND, UINT, WPARAM, LPARAM);
  36. LRESULT MsgActivateApp(HWND, UINT, WPARAM, LPARAM);
  37. LRESULT MsgDisplayChange(HWND, UINT, WPARAM, LPARAM);
  38. LRESULT MsgCreate(HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  40.  
  41.  
  42.  
  43. //-------------------------------------------------------------------------
  44. // Functions for handling main window commands--ie. functions for
  45. // processing WM_COMMAND messages based on the wParam value.
  46. // The message-dispatching mechanism expects all command-handling
  47. // functions to have the following prototype:
  48. //
  49. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  50.  
  51. LRESULT CmdExit(HWND, WORD, WORD, HWND);
  52. LRESULT CmdRefreshDisplay(HWND, WORD, WORD, HWND);
  53. LRESULT CmdKillProcess(HWND, WORD, WORD, HWND);
  54. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  55.  
  56. //-------------------------------------------------------------------------
  57. // Global function prototypes.
  58.  
  59. BOOL InitApplication(HINSTANCE, int);
  60. BOOL CenterWindow(HWND, HWND);
  61. HWND CreateAppToolbar(HWND hwndParent, WORD wID);
  62. void DrawResizeLine(HWND hwnd, LONG yPos);
  63. BOOL InitApp(void);
  64.  
  65.     // Callback functions.  These are called by Windows.
  66. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  67.  
  68.  
  69. //-------------------------------------------------------------------------
  70. // Global variable declarations.  Definition location is in parenthesis.
  71.  
  72. extern HINSTANCE hInst;          // The current instance handle (INIT.C)
  73. extern char      szAppName[];    // The name of this application (INIT.C)
  74. extern char      szTitle[];      // The title bar text (INIT.C)
  75.  
  76. extern HWND g_hwndMain;          // Main window's handle (PVIEW95.C)
  77. extern HWND g_hwndProcess;       // Process listview's handle (PVIEW95.C)
  78. extern HWND g_hwndThread;        // Thread listview's handle (PVIEW95.C)
  79.  
  80. #define hwndMDIClient NULL        /* Stub for NON-MDI applications. */
  81.  
  82.  
  83. //-------------------------------------------------------------------------
  84. // Message and command dispatch infrastructure.  The following type
  85. // definitions and functions are used by the message and command dispatching
  86. // mechanism and do not need to be changed.
  87.  
  88.     // Function pointer prototype for message handling functions.
  89. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  90.  
  91.     // Function pointer prototype for command handling functions.
  92. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  93.  
  94.     // Enumerated type used to determine which default window procedure
  95.     // should be called by the message- and command-dispatching mechanism
  96.     // if a message or command is not handled explicitly.
  97. typedef enum
  98. {
  99.    edwpNone,            // Do not call any default procedure.
  100.    edwpWindow,          // Call DefWindowProc.
  101.    edwpDialog,          // Call DefDlgProc (This should be used only for
  102.                         // custom dialogs - standard dialog use edwpNone).
  103.    edwpMDIChild,        // Call DefMDIChildProc.
  104.    edwpMDIFrame         // Call DefFrameProc.
  105. } EDWP;                // Enumeration for Default Window Procedures
  106.  
  107.     // This structure maps messages to message handling functions.
  108. typedef struct _MSD
  109. {
  110.     UINT   uMessage;
  111.     PFNMSG pfnmsg;
  112. } MSD;                 // MeSsage Dispatch structure
  113.  
  114.     // This structure contains all of the information that a window
  115.     // procedure passes to DispMessage in order to define the message
  116.     // dispatching behavior for the window.
  117. typedef struct _MSDI
  118. {
  119.     int  cmsd;          // Number of message dispatch structs in rgmsd
  120.     MSD *rgmsd;         // Table of message dispatch structures
  121.     EDWP edwp;          // Type of default window handler needed.
  122. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  123.  
  124.     // This structure maps command IDs to command handling functions.
  125. typedef struct _CMD
  126. {
  127.     WORD   wCommand;
  128.     PFNCMD pfncmd;
  129. } CMD;                 // CoMmand Dispatch structure
  130.  
  131.     // This structure contains all of the information that a command
  132.     // message procedure passes to DispCommand in order to define the
  133.     // command dispatching behavior for the window.
  134. typedef struct _CMDI
  135. {
  136.     int  ccmd;          // Number of command dispatch structs in rgcmd
  137.     CMD *rgcmd;         // Table of command dispatch structures
  138.     EDWP edwp;          // Type of default window handler needed.
  139. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  140.  
  141.     // Message and command dispatching functions.  They look up messages
  142.     // and commands in the dispatch tables and call the appropriate handler
  143.     // function.
  144. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  145. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  146.  
  147.     // Message dispatch information for the main window
  148. extern MSDI msdiMain;
  149.     // Command dispatch information for the main window
  150. extern CMDI cmdiMain;
  151.