home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / spy / app / spy.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  4KB  |  166 lines

  1.  
  2. /******************************************************************************\
  3. *       This is a part of the Microsoft Source Code Samples. 
  4. *       Copyright (C) 1993-1997 Microsoft Corporation.
  5. *       All rights reserved. 
  6. *       This source code is only intended as a supplement to 
  7. *       Microsoft Development Tools and/or WinHelp documentation.
  8. *       See these sources for detailed information regarding the 
  9. *       Microsoft samples programs.
  10. \******************************************************************************/
  11.  
  12. /*****************************************************************************\
  13. *
  14. * Module: spy.h
  15. *
  16. *   Main include file for the Windows debugging Spy SDK applet.
  17. *
  18. \*****************************************************************************/
  19.  
  20. #include <windows.h>
  21.  
  22. #ifdef  FE_IME
  23. #include <ime.h>
  24. #endif
  25.  
  26. #include "dialogs.h"
  27. #include "..\hook.h"
  28.  
  29.  
  30. #define MAXSTRING                   MAX_PATH
  31.  
  32. #define LINES_MAX                   250         // Max lines allowed in window.
  33.  
  34.  
  35. //
  36. // Message Table Flags
  37. //
  38. #define MTF_SELECTED                0x00000001
  39.  
  40. #define MTF_TYPE_MOUSE              0x00010000
  41. #define MTF_TYPE_DDE                0x00020000
  42. #define MTF_TYPE_CLIP               0x00040000
  43. #define MTF_TYPE_NC                 0x00080000
  44. #define MTF_TYPE_KEYBD              0x00100000
  45. #define MTF_TYPE_LB                 0x00200000
  46. #define MTF_TYPE_BM                 0x00400000
  47. #define MTF_TYPE_STM                0x00800000
  48. #define MTF_TYPE_CB                 0x01000000
  49. #define MTF_TYPE_EM                 0x02000000
  50. #ifdef FE_IME
  51. #define MTF_TYPE_IME                0x04000000
  52. #endif
  53.  
  54.  
  55. //
  56. // Menu ids.
  57. //
  58.  
  59. #define MENU_SPY_SELECTWINDOW       1000
  60. #define MENU_SPY_ABOUT              1001
  61. #define MENU_SPY_EXIT               1002
  62.  
  63. #define MENU_EDIT_CUT               1100
  64. #define MENU_EDIT_COPY              1101
  65. #define MENU_EDIT_CLEAR             1102
  66.  
  67. #define MENU_OPTIONS_MESSAGES       1200
  68. #define MENU_OPTIONS_FONT           1201
  69. #define MENU_OPTIONS_OUTPUT         1202
  70.  
  71. #define MENU_START                  1300
  72. #define MENU_STOP                   1301
  73.  
  74. //
  75. // Resource file constants
  76. //
  77. #define IDS_APPLICATION_NAME        2000
  78. #define IDS_MENU_START              2001
  79. #define IDS_MENU_STOP               2002
  80. #define IDS_PARENT                  2003
  81. #define IDS_NOPARENT                2004
  82. #define IDS_UNDEFINED               2005
  83. #define IDS_ERROR_WND_LINE          2006
  84. #define IDS_ERROR_CANT_OPEN_FILE    2007
  85. #define IDS_ERROR_CANT_OPEN_COM1    2008
  86. #define IDS_ERROR_CANT_LOAD_DLL     2009
  87.  
  88. //
  89. // Position of the top level Start/Stop menu item.
  90. //
  91. #define MENUPOS_STARTSTOP           3
  92.  
  93.  
  94. //
  95. // Prototype for the Message Decode functions.
  96. //
  97. typedef VOID (*LPFNDECODE)(HWND, UINT, PSPYMSGDATA);
  98.  
  99.  
  100. //
  101. // The Message Description Table structure that describes each message
  102. // that Spy understands.
  103. //
  104. typedef struct
  105. {
  106.     LPTSTR pszMsg;
  107.     UINT msg;
  108.     UINT Flags;
  109.     LPFNDECODE pfnDecode;
  110. } MSGDESC, *PMSGDESC;
  111.  
  112.  
  113. //
  114. // The message group structure.  A table of these structures describes
  115. // each different group of messages that can be selected/deselected
  116. // for spying on using the Messages dialog.
  117. //
  118. typedef struct
  119. {
  120.     INT idCheckBox;
  121.     DWORD flMask;
  122.     INT cMsgs;
  123.     INT cUseCount;
  124. } MSGGROUP, *PMSGGROUP;
  125.  
  126.  
  127. extern HANDLE ghInst;
  128. extern HWND ghwndSpyApp;
  129. extern HWND ghwndPrintf;
  130. extern HANDLE ghHookThread;
  131. extern HWND ghwndSpyHook;
  132. extern HWND ghwndSpyingOn;              // The window we are spying on.
  133. extern HFONT ghfontPrintf;
  134. extern INT gnLines;
  135. extern BOOL gfSpyOn;
  136. extern BOOL gfSpyAll;
  137. extern BOOL gfOutputWin;
  138. extern BOOL gfOutputCom1;
  139. extern BOOL gfOutputFile;
  140. extern HFILE gfhFile;
  141. extern HANDLE gfhCom1;
  142. extern CHAR gszFile[];
  143. extern INT gcxBorder;
  144. extern INT gcyBorder;
  145. extern BOOL gfMsgsUser;
  146. extern BOOL gfMsgsUnknown;
  147. extern CHAR gszAppName[];
  148. extern UCHAR gszWindowName[];
  149. extern WINDOWPLACEMENT gwndpl;
  150.  
  151. extern MSGDESC gaMsgs[];
  152. extern INT gcMessages;
  153. extern MSGGROUP gaMsgGroup[];
  154. extern INT gcMsgGroups;
  155. extern INT gaiSelected[];
  156. extern INT gaiSelected2[];
  157.  
  158.  
  159. #include "spyfuncs.h"
  160. #include "wprintf.h"
  161.  
  162. #ifdef FE_IME
  163. #include <ime.h>               //  For WM_IME_REPORT
  164. #include <winuser.h>           //  For WM_IMEKEYDOWN, WM_IMEKEYUP
  165. #endif
  166.