home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / INPUT.PAK / GLOBALS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  5.2 KB  |  135 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       Input
  18.  
  19.  
  20. //-------------------------------------------------------------------------
  21. // Functions for handling main window messages.  The message-dispatching
  22. // mechanism expects all message-handling functions to have the following
  23. // prototype:
  24. //
  25. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  26.  
  27. // **TODO**  Add message-handling function prototypes here.  Be sure to
  28. //           add the function names to the main window message table in
  29. //           input.c.
  30.  
  31. LRESULT MsgCommand(HWND, UINT, WPARAM, LPARAM);
  32. LRESULT MsgCreate(HWND, UINT, WPARAM, LPARAM);
  33. LRESULT MsgDestroy(HWND, UINT, WPARAM, LPARAM);
  34. LRESULT MsgMouseMove(HWND, UINT, WPARAM, LPARAM);
  35. LRESULT MsgLButtonDown(HWND, UINT, WPARAM, LPARAM);
  36. LRESULT MsgLButtonUp(HWND, UINT, WPARAM, LPARAM);
  37. LRESULT MsgLButtonDoubleClick(HWND, UINT, WPARAM, LPARAM);
  38. LRESULT MsgRButtonDown(HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgRButtonUp(HWND, UINT, WPARAM, LPARAM);
  40. LRESULT MsgRButtonDoubleClick(HWND, UINT, WPARAM, LPARAM);
  41. LRESULT MsgKeyDown(HWND, UINT, WPARAM, LPARAM);
  42. LRESULT MsgKeyUp(HWND, UINT, WPARAM, LPARAM);
  43. LRESULT MsgChar(HWND, UINT, WPARAM, LPARAM);
  44. LRESULT MsgTimer(HWND, UINT, WPARAM, LPARAM);
  45. LRESULT MsgScroll(HWND, UINT, WPARAM, LPARAM);
  46. LRESULT MsgScroll(HWND, UINT, WPARAM, LPARAM);
  47. LRESULT MsgPaint(HWND, UINT, WPARAM, LPARAM);
  48.  
  49.  
  50. //-------------------------------------------------------------------------
  51. // Global function prototypes.
  52.  
  53. // **TODO**  Add global function prototypes here.
  54.  
  55. BOOL InitApplication(HINSTANCE);
  56. BOOL InitInstance(HINSTANCE, int);
  57. BOOL InitInput(HWND);
  58.  
  59.     // Callback functions.  These are called by Windows.
  60.  
  61. // **TODO**  Add new callback function prototypes here.  Win16 compiles
  62. //           require the __export keyword to generate proper prolog
  63. //           and epilog code for exported functions.
  64.  
  65. #ifdef WIN16
  66.  
  67. LRESULT CALLBACK __export WndProc(HWND, UINT, WPARAM, LPARAM);
  68.  
  69. #else
  70.  
  71. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  72.  
  73. #endif
  74.  
  75.  
  76. //-------------------------------------------------------------------------
  77. // Global variable declarations.
  78.  
  79. extern HINSTANCE hInst;          // The current instance handle
  80. extern char      szAppName[];    // The name of this application
  81. extern char      szTitle[];      // The title bar text
  82.  
  83. // **TODO**  For NON-MDI applications, uncomment line 1 below and comment
  84. //           line 2.  For MDI applications, uncomment line 2 below, comment
  85. //           line 1, and then define hwndMDIClient as a global variable in
  86. //           INIT.C
  87. #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
  88. // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
  89.  
  90.  
  91. //-------------------------------------------------------------------------
  92. // Message dispatch infrastructure.  The following type
  93. // definitions and functions are used by the message 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.     // 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.     // Message dispatching function.  This looks up messages in the
  130.     // dispatch table and call the appropriate handler function.
  131. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  132.  
  133.     // Message dispatch information for the main window
  134. extern MSDI msdiMain;
  135.