|
|
1.1 root 1: /* Put in include to dummy memory allocator */
2: #include "allocmem.h"
3:
4: /****** Resource IDs *****/
5:
6: #define IDR_SPY 1
7: #define IDR_SPYR 2
8: #define IDD_DLGSPY 0x001
9: #define IDD_MessagesDlg 0x002
10: #define IDD_OutputsDlg 0x003
11: #define IDD_WindowsDlg 0x004
12: #define IDD_SaveListDlg 0x005
13: #define IDD_About1Dlg 0x006
14: #define IDD_ListNearDlg 0x008
15: #define IDD_MsgQueueDlg 0x009
16: #define IDD_SendMsgDlg 0x00A
17:
18: /****** Menu command IDs *****/
19: /* (by convention, hi byte is menu index, lo byte is dispatch table index) */
20:
21: /* Top level Menu Ids */
22: #define MNU_SPY 0x1000
23: #define MNU_WINDOWS 0x1100
24: #define MNU_WNDSEL 0x1110
25: #define MNU_WNDDUMP 0x1120
26: #define MNU_MESSAGES 0x1200
27: #define MNU_HOOKS 0x1300
28: #define MNU_SNDOUTPUT 0x1310
29: #define MNU_OUTPUTS 0x1400
30: #define MNU_HELP 0x1500
31:
32:
33: /* Spy Menu */
34: #define CMD_ACTIVE 0x0100
35: #define CMD_EXIT 0x0101
36: #define CMD_CLRWIN 0x0102
37: #define CMD_SAVEWIN 0x0103
38: #define CMD_SAVEOPT 0x0104
39:
40: /* Window Menu */
41: #define CMD_WINDOWS 0x0200
42: #define CMD_QUEUES 0x0201
43: #define CMD_WNMSSEL 0x0202
44: #define CMD_WNMSDSL 0x0203
45: #define CMD_ALLWNDWS 0x0204
46: #define CMD_ALLFRAMES 0x0205
47: #define CMD_WNDPWIN 0x0206
48: #define CMD_WNDPALL 0x0207
49: #define CMD_DACCEL 0x0208
50:
51: /* Message Menu */
52: #define CMD_MESSAGES 0x0300
53: #define CMD_MGDABLE 0x0301
54: #define CMD_MGEABLE 0x0302
55: #define CMD_ALPHASORT 0x0303
56: #define CMD_SENDMSG 0x0304
57:
58: /* Hooks Menu */
59: #define CMD_INPUTHOOK 0x0400
60: #define CMD_SENDMSGHOOK 0x0401
61: #define CMD_SENDEXTEND 0x0402
62: #define CMD_SENDSTACK 0x0403
63:
64: /* Outputs Menu */
65: #define CMD_OUTSCREEN 0x0500
66: #define CMD_OUTTERM 0x0501
67: #define CMD_OUTFILE 0x0502
68: #define CMD_OUTPUTS 0x0503
69:
70: /* Help Menu */
71: #define CMD_HOWHELP 0x0600
72: #define CMD_HELPEXTENDED 0x0601
73: #define CMD_HELPKEYS 0x0602
74: #define CMD_HELPINDEX 0x0603
75: #define CMD_ABOUT 0x0604
76:
77: /* From the Main Dialog */
78: #define DID_SPYLIST 0x0001
79:
80:
81: /* From the Options Dialog */
82: #define DID_OMSGLIST 0x0100
83: #define DID_MALL 0x0101
84: #define DID_MNONE 0x0102
85: #define DID_MCON 0x0103
86: #define DID_MCOFF 0x0104
87: #define DID_MMON 0x0105
88: #define DID_MMOFF 0x0106
89: #define DID_MFON 0x0107
90: #define DID_MFOFF 0x0108
91: #define DID_MSGEDIT 0x0109
92:
93: #define DID_OINPUT 0x0120
94: #define DID_OSENDMSG 0x0121
95: #define DID_OTHERMSGS 0x0122
96:
97: #define DID_WINDOW 0x0110
98: #define DID_DEBUG 0x0111
99: #define DID_FILE 0x0112
100: #define DID_WINDOWLINES 0x0113
101: #define DID_FILENAME 0x0114
102:
103: /* From the Windows Dialog */
104: #define DID_WSELALL 0x0200
105: #define DID_WUNSELALL 0x0201
106: #define DID_WSELMOUSE 0x0202
107:
108: #define DID_WINDOWLIST 0x0203
109: #define DID_WHANDLE 0x0204
110: #define DID_WTEXT 0x0205
111: #define DID_WCLASS 0x0206
112: #define DID_WPARENT 0x0207
113: #define DID_WCHILD 0x0208
114: #define DID_WOWNER 0x0209
115: #define DID_WRECT 0x020a
116: #define DID_WID 0x020b
117: #define DID_WSTYLE 0x020c
118: #define DID_WCSTYLE 0x020d
119: #define DID_WPFNWP 0x020e
120: #define DID_WHMQ 0x020f
121: #define DID_WPID 0x0210
122: #define DID_WTID 0x0211
123: #define DID_WOLINE1 0x0212
124: #define DID_WOLINE2 0x0213
125: #define DID_WOLINE3 0x0214
126: #define DID_WOLINE4 0x0215
127:
128: /* From the save file dialog */
129: #define DID_APPEND 0x0300
130:
131: /* From the About dialog */
132: #define DID_ICON 0x0500
133: #define DID_ICONR 0x0501
134:
135: /* From the Send Message dialog */
136: #define DID_HWND 0x0600
137: #define DID_SELHWND 0x0601
138: #define DID_COMMAND 0x0602
139: #define DID_MPARAM1 0x0603
140: #define DID_MPARAM2 0x0604
141: #define DID_RESULT 0x0605
142: #define DID_STRING1 0x0606
143: #define DID_STRING2 0x0607
144: #define DID_POST 0x0608
145: #define DID_SEND 0x0609
146:
147: /*
148: * Define data structures
149: */
150: typedef struct _SPYOPT { /* Spy Options */
151: /* Now define the output options */
152: /* In options dialog */
153: BOOL fWindow;
154: BOOL fDebugOutput;
155: BOOL fFile;
156: SHORT cWindowLines;
157: HFILE hfileSpy; /* if all lines go to file */
158:
159: /* SendMsg Hook Output options */
160: USHORT bHooks; /* Which hooks are enabled */
161: BOOL fSendExtend; /* Should extended data be displayed */
162: BOOL fSendStack; /* Should call stack be displayed */
163:
164: /* In Save file dialog */
165: BOOL fAppend;
166:
167: /* In Message Dialog */
168: BOOL fDispOtherMsgs; /* Undefined messages displayed? */
169: BOOL fAlphaSortMsgList; /* Should the message list be sorted */
170:
171: } SPYOPT; /* spyoptions */
172:
173: typedef struct _spystr {
174:
175: /* Define file names at end, will define as seperate strings in os2.ini */
176: CHAR szFileName[100];
177: char szSaveFileName[100];
178: } SPYSTR; /* Strings are seperated from options */
179:
180: typedef struct _IDTONAME {
181: USHORT id; /* id of window */
182: char *szIdName; /* String with text of ID */
183: } IDTONAME;
184:
185: /*
186: * Define the system defined limits
187: */
188: /* This is a real hack, estimate size of WND Structure */
189: #define SIZEOFWND 34
190: #define MAXMSGBYTES 100
191:
192: /*
193: * Define Message output information
194: */
195:
196: #define MSGI_ENABLED 0x0001
197: #define MSGI_MOUSE 0x0002 /* Mouse type messages */
198: #define MSGI_KEY 0x0004 /* Key type messages */
199: #define MSGI_FREQ 0x0010 /* Frequent messages generaly ignored */
200:
201:
202: typedef struct _MSGI {
203:
204: USHORT msg;
205: char *szMsg;
206: USHORT wOptions;
207: UCHAR bMPTypes;
208: SHORT iListBox;
209: } MSGI;
210:
211: /*
212: * Now define all of the global strutures that are exported from
213: * the initializition file
214: */
215: extern SPYOPT spyopt;
216: extern SPYSTR spystr;
217: extern MSGI rgmsgi[];
218: extern SHORT cmsgi; /* Count of message info items */
219: extern IDTONAME rgidtoname[];
220: extern SHORT cToName; /* Count of items in cToName */
221:
222:
223: /*
224: * External definitions used between source files
225: */
226:
227: extern HAB hab;
228: extern HMQ hmqSpy;
229: extern HWND hwndSpy;
230: extern HWND hwndSpyFrame;
231: extern HWND hwndSpyList;
232: extern HWND hwndWindowLB;
233: extern HWND hwndMessageLB;
234: extern HWND hwndHelpInstance;
235: extern HHEAP hHeap;
236: extern SHORT cxBorder;
237: extern SHORT cyBorder;
238:
239: extern HPOINTER hptrArrow;
240: extern HPOINTER hptrSelWin;
241:
242: extern BOOL fDebug;
243: extern USHORT iCurItemFocus; /* Index to item that has the focus */
244: extern BOOL fSpyActive; /* Any non-zero is true */
245: extern BOOL fTrackingListBox; /* Tracking windows active ? */
246: extern BOOL fAllFrames; /* Are we processing all frames ? */
247: extern BOOL fAllWindows; /* Are we processing all windows ? */
248:
249: extern HWND hwndWinDlgDisp; /* hwnds info in Window Dialog */
250:
251:
252:
253: /*
254: * simple structure for sorting Hwnds in dumping
255: */
256: typedef struct _spwd {
257: HWND hwnd;
258: SHORT index;
259: } SPWD;
260:
261: #define MAXSPYDUMP 1000 /* Max of a thousand windows */
262: extern SHORT wDumpCount; /* Count of which window is being dumped */
263: extern SPWD *pspwd;
264:
265:
266: /*
267: * Data definitions for Dumping Accelerator tables, etc
268: */
269: // Define some simple accel table stuff
270: typedef struct _aftos {
271: USHORT usBit;
272: char *szBit;
273: } AFTOS;
274:
275: extern AFTOS aaftos[];
276: extern SHORT caftos;
277:
278: // Vkey to string table
279: typedef struct _vktos {
280: char *szVkey;
281: } VKTOS;
282:
283:
284: extern VKTOS avktos[];
285: extern USHORT ivktosMin; // Min index that has data.
286: extern USHORT cvktos; // count of items in table.
287:
288: /*
289: * External function definitions
290: */
291: /*
292: * Spy.c
293: */
294: extern MRESULT EXPENTRY SpyWndProc(HWND, USHORT, MPARAM, MPARAM);
295: extern USHORT UConvertStringToNum(char *);
296: extern void OutputString(char [], SHORT);
297: extern MSGI *PmsgiFromMsg(USHORT);
298:
299: /*
300: * Message.c
301: */
302: extern MRESULT EXPENTRY SpyMsgDlgProc(HWND, USHORT, MPARAM, MPARAM);
303: extern void UpdateHooksMsgTable(void);
304: extern void EnableOrDisableMsg(BOOL);
305: extern MRESULT EXPENTRY SendMsgDlgProc(HWND, USHORT, MPARAM, MPARAM);
306:
307: /*
308: * Options.c
309: */
310: extern MRESULT EXPENTRY SpyOutputsDlgProc(HWND, USHORT, MPARAM, MPARAM);
311: extern MRESULT EXPENTRY SpySaveListDlgProc(HWND, USHORT, MPARAM, MPARAM);
312: extern MRESULT EXPENTRY AboutWndProc(HWND, USHORT, MPARAM, MPARAM);
313:
314: /*
315: * Queue.c
316: */
317: extern MRESULT EXPENTRY SpyQueuesDlgProc(HWND, USHORT, MPARAM, MPARAM);
318: extern void EnableOrDisableMsg(BOOL);
319: extern void UpdateHooksMsgTable(void);
320:
321: /*
322: * Window.c
323: */
324: extern MRESULT EXPENTRY SpyWindowsDlgProc(HWND, USHORT, MPARAM, MPARAM);
325: extern void DumpOneWindowInfo(void);
326: extern SHORT DumpAllWindowsInfo(HWND, SHORT);
327: extern void DumpFrameAcclTable(void);
328: extern void DumpWindowIndex(SHORT);
329: extern void SelOrDeselWithMouse(BOOL);
330: extern HWND HwndSelWinWithMouse(HWND, void (*)(HWND, HWND), BOOL);
331:
332: /*
333: * SpyUtil.asm
334: */
335: extern BOOL FGuessValidPointer (PVOID pVoid, SHORT cbStruct,
336: ULONG ulMemFlags);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.