- Minor API files fixes
[wine/multimedia.git] / windows / spy.c
blobbdee905ef156eecb2f7547b788ca3a36401b411f
1 /*
2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
5 * 1995, Alex Korobka
6 */
8 #include <stdlib.h>
9 #include <string.h>
10 #include <stdio.h>
11 #include "windef.h"
12 #include "wingdi.h"
13 #include "wine/winuser16.h"
14 #include "wine/winbase16.h"
15 #include "win.h"
16 #include "options.h"
17 #include "debugtools.h"
18 #include "spy.h"
19 #include "commctrl.h"
21 DEFAULT_DEBUG_CHANNEL(message);
23 #define SPY_MAX_MSGNUM WM_USER
24 #define SPY_INDENT_UNIT 4 /* 4 spaces */
26 static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
28 "wm_null", /* 0x00 */
29 "WM_CREATE",
30 "WM_DESTROY",
31 "WM_MOVE",
32 "wm_sizewait",
33 "WM_SIZE",
34 "WM_ACTIVATE",
35 "WM_SETFOCUS",
36 "WM_KILLFOCUS",
37 "WM_SETVISIBLE",
38 "WM_ENABLE",
39 "WM_SETREDRAW",
40 "WM_SETTEXT",
41 "WM_GETTEXT",
42 "WM_GETTEXTLENGTH",
43 "WM_PAINT",
44 "WM_CLOSE", /* 0x10 */
45 "WM_QUERYENDSESSION",
46 "WM_QUIT",
47 "WM_QUERYOPEN",
48 "WM_ERASEBKGND",
49 "WM_SYSCOLORCHANGE",
50 "WM_ENDSESSION",
51 "wm_systemerror",
52 "WM_SHOWWINDOW",
53 "WM_CTLCOLOR",
54 "WM_WININICHANGE",
55 "WM_DEVMODECHANGE",
56 "WM_ACTIVATEAPP",
57 "WM_FONTCHANGE",
58 "WM_TIMECHANGE",
59 "WM_CANCELMODE",
60 "WM_SETCURSOR", /* 0x20 */
61 "WM_MOUSEACTIVATE",
62 "WM_CHILDACTIVATE",
63 "WM_QUEUESYNC",
64 "WM_GETMINMAXINFO",
65 "wm_unused3",
66 "wm_painticon",
67 "WM_ICONERASEBKGND",
68 "WM_NEXTDLGCTL",
69 "wm_alttabactive",
70 "WM_SPOOLERSTATUS",
71 "WM_DRAWITEM",
72 "WM_MEASUREITEM",
73 "WM_DELETEITEM",
74 "WM_VKEYTOITEM",
75 "WM_CHARTOITEM",
76 "WM_SETFONT", /* 0x30 */
77 "WM_GETFONT",
78 "WM_SETHOTKEY",
79 "WM_GETHOTKEY",
80 "wm_filesyschange",
81 "wm_isactiveicon",
82 "wm_queryparkicon",
83 "WM_QUERYDRAGICON",
84 "wm_querysavestate",
85 "WM_COMPAREITEM",
86 "wm_testing",
87 NULL,
88 "wm_otherwindowcreated",
89 "wm_otherwindowdestroyed",
90 "wm_activateshellwindow",
91 NULL,
93 NULL, /* 0x40 */
94 "wm_compacting", NULL, NULL,
95 "WM_COMMNOTIFY", NULL,
96 "WM_WINDOWPOSCHANGING", /* 0x0046 */
97 "WM_WINDOWPOSCHANGED", /* 0x0047 */
98 "WM_POWER", NULL,
99 "WM_COPYDATA",
100 "WM_CANCELJOURNAL", NULL, NULL,
101 "WM_NOTIFY", NULL,
103 /* 0x0050 */
104 "WM_INPUTLANGCHANGEREQUEST",
105 "WM_INPUTLANGCHANGE",
106 "WM_TCARD",
107 "WM_HELP",
108 "WM_USERCHANGED",
109 "WM_NOTIFYFORMAT", NULL, NULL,
110 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
112 /* 0x0060 */
113 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
114 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
116 /* 0x0070 */
117 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
118 NULL, NULL, NULL,
119 "WM_CONTEXTMENU",
120 "WM_STYLECHANGING",
121 "WM_STYLECHANGED",
122 "WM_DISPLAYCHANGE",
123 "WM_GETICON",
125 "WM_SETICON", /* 0x0080 */
126 "WM_NCCREATE", /* 0x0081 */
127 "WM_NCDESTROY", /* 0x0082 */
128 "WM_NCCALCSIZE", /* 0x0083 */
129 "WM_NCHITTEST", /* 0x0084 */
130 "WM_NCPAINT", /* 0x0085 */
131 "WM_NCACTIVATE", /* 0x0086 */
132 "WM_GETDLGCODE", /* 0x0087 */
133 "WM_SYNCPAINT",
134 "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL,
136 /* 0x0090 */
137 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
138 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
140 /* 0x00A0 */
141 "WM_NCMOUSEMOVE", /* 0x00A0 */
142 "WM_NCLBUTTONDOWN", /* 0x00A1 */
143 "WM_NCLBUTTONUP", /* 0x00A2 */
144 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
145 "WM_NCRBUTTONDOWN", /* 0x00A4 */
146 "WM_NCRBUTTONUP", /* 0x00A5 */
147 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
148 "WM_NCMBUTTONDOWN", /* 0x00A7 */
149 "WM_NCMBUTTONUP", /* 0x00A8 */
150 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
151 NULL, NULL, NULL, NULL, NULL, NULL,
153 /* 0x00B0 - Win32 Edit controls */
154 "EM_GETSEL32", /* 0x00b0 */
155 "EM_SETSEL32", /* 0x00b1 */
156 "EM_GETRECT32", /* 0x00b2 */
157 "EM_SETRECT32", /* 0x00b3 */
158 "EM_SETRECTNP32", /* 0x00b4 */
159 "EM_SCROLL32", /* 0x00b5 */
160 "EM_LINESCROLL32", /* 0x00b6 */
161 "EM_SCROLLCARET32", /* 0x00b7 */
162 "EM_GETMODIFY32", /* 0x00b8 */
163 "EM_SETMODIFY32", /* 0x00b9 */
164 "EM_GETLINECOUNT32", /* 0x00ba */
165 "EM_LINEINDEX32", /* 0x00bb */
166 "EM_SETHANDLE32", /* 0x00bc */
167 "EM_GETHANDLE32", /* 0x00bd */
168 "EM_GETTHUMB32", /* 0x00be */
169 NULL, /* 0x00bf */
171 NULL, /* 0x00c0 */
172 "EM_LINELENGTH32", /* 0x00c1 */
173 "EM_REPLACESEL32", /* 0x00c2 */
174 NULL, /* 0x00c3 */
175 "EM_GETLINE32", /* 0x00c4 */
176 "EM_LIMITTEXT32", /* 0x00c5 */
177 "EM_CANUNDO32", /* 0x00c6 */
178 "EM_UNDO32", /* 0x00c7 */
179 "EM_FMTLINES32", /* 0x00c8 */
180 "EM_LINEFROMCHAR32", /* 0x00c9 */
181 NULL, /* 0x00ca */
182 "EM_SETTABSTOPS32", /* 0x00cb */
183 "EM_SETPASSWORDCHAR32", /* 0x00cc */
184 "EM_EMPTYUNDOBUFFER32", /* 0x00cd */
185 "EM_GETFIRSTVISIBLELINE32", /* 0x00ce */
186 "EM_SETREADONLY32", /* 0x00cf */
188 "EM_SETWORDBREAKPROC32", /* 0x00d0 */
189 "EM_GETWORDBREAKPROC32", /* 0x00d1 */
190 "EM_GETPASSWORDCHAR32", /* 0x00d2 */
191 "EM_SETMARGINS32", /* 0x00d3 */
192 "EM_GETMARGINS32", /* 0x00d4 */
193 "EM_GETLIMITTEXT32", /* 0x00d5 */
194 "EM_POSFROMCHAR32", /* 0x00d6 */
195 "EM_CHARFROMPOS32", /* 0x00d7 */
196 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
198 /* 0x00E0 - Win32 Scrollbars */
199 "SBM_SETPOS32", /* 0x00e0 */
200 "SBM_GETPOS32", /* 0x00e1 */
201 "SBM_SETRANGE32", /* 0x00e2 */
202 "SBM_GETRANGE32", /* 0x00e3 */
203 "SBM_ENABLE_ARROWS32", /* 0x00e4 */
204 NULL,
205 "SBM_SETRANGEREDRAW32", /* 0x00e6 */
206 NULL, NULL,
207 "SBM_SETSCROLLINFO32", /* 0x00e9 */
208 "SBM_GETSCROLLINFO32", /* 0x00ea */
209 NULL, NULL, NULL, NULL, NULL,
211 /* 0x00F0 - Win32 Buttons */
212 "BM_GETCHECK32", /* 0x00f0 */
213 "BM_SETCHECK32", /* 0x00f1 */
214 "BM_GETSTATE32", /* 0x00f2 */
215 "BM_SETSTATE32", /* 0x00f3 */
216 "BM_SETSTYLE32", /* 0x00f4 */
217 "BM_CLICK32", /* 0x00f5 */
218 "BM_GETIMAGE32", /* 0x00f6 */
219 "BM_SETIMAGE32", /* 0x00f7 */
220 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
222 "WM_KEYDOWN", /* 0x0100 */
223 "WM_KEYUP", /* 0x0101 */
224 "WM_CHAR", /* 0x0102 */
225 "WM_DEADCHAR", /* 0x0103 */
226 "WM_SYSKEYDOWN", /* 0x0104 */
227 "WM_SYSKEYUP", /* 0x0105 */
228 "WM_SYSCHAR", /* 0x0106 */
229 "WM_SYSDEADCHAR", /* 0x0107 */
230 "WM_KEYLAST", /* 0x0108 */
231 NULL,
232 "WM_CONVERTREQUEST",
233 "WM_CONVERTRESULT",
234 "WM_INTERIM",
235 "WM_IME_STARTCOMPOSITION", /* 0x010d */
236 "WM_IME_ENDCOMPOSITION", /* 0x010e */
237 "WM_IME_COMPOSITION", /* 0x010f */
239 "WM_INITDIALOG", /* 0x0110 */
240 "WM_COMMAND", /* 0x0111 */
241 "WM_SYSCOMMAND", /* 0x0112 */
242 "WM_TIMER", /* 0x0113 */
243 "WM_HSCROLL", /* 0x0114 */
244 "WM_VSCROLL", /* 0x0115 */
245 "WM_INITMENU", /* 0x0116 */
246 "WM_INITMENUPOPUP", /* 0x0117 */
247 "WM_SYSTIMER", /* 0x0118 */
248 NULL, NULL, NULL, NULL, NULL, NULL,
249 "WM_MENUSELECT", /* 0x011f */
251 "WM_MENUCHAR", /* 0x0120 */
252 "WM_ENTERIDLE", /* 0x0121 */
253 NULL, NULL, NULL, NULL, NULL, NULL,
254 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
256 /* 0x0130 */
257 NULL,
258 "WM_LBTRACKPOINT", /* 0x0131 */
259 "WM_CTLCOLORMSGBOX", /* 0x0132 */
260 "WM_CTLCOLOREDIT", /* 0x0133 */
261 "WM_CTLCOLORLISTBOX", /* 0x0134 */
262 "WM_CTLCOLORBTN", /* 0x0135 */
263 "WM_CTLCOLORDLG", /* 0x0136 */
264 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
265 "WM_CTLCOLORSTATIC", /* 0x0138 */
266 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
268 /* 0x0140 - Win32 Comboboxes */
269 "CB_GETEDITSEL32", /* 0x0140 */
270 "CB_LIMITTEXT32", /* 0x0141 */
271 "CB_SETEDITSEL32", /* 0x0142 */
272 "CB_ADDSTRING32", /* 0x0143 */
273 "CB_DELETESTRING32", /* 0x0144 */
274 "CB_DIR32", /* 0x0145 */
275 "CB_GETCOUNT32", /* 0x0146 */
276 "CB_GETCURSEL32", /* 0x0147 */
277 "CB_GETLBTEXT32", /* 0x0148 */
278 "CB_GETLBTEXTLEN32", /* 0x0149 */
279 "CB_INSERTSTRING32", /* 0x014a */
280 "CB_RESETCONTENT32", /* 0x014b */
281 "CB_FINDSTRING32", /* 0x014c */
282 "CB_SELECTSTRING32", /* 0x014d */
283 "CB_SETCURSEL32", /* 0x014e */
284 "CB_SHOWDROPDOWN32", /* 0x014f */
286 "CB_GETITEMDATA32", /* 0x0150 */
287 "CB_SETITEMDATA32", /* 0x0151 */
288 "CB_GETDROPPEDCONTROLRECT32",/* 0x0152 */
289 "CB_SETITEMHEIGHT32", /* 0x0153 */
290 "CB_GETITEMHEIGHT32", /* 0x0154 */
291 "CB_SETEXTENDEDUI32", /* 0x0155 */
292 "CB_GETEXTENDEDUI32", /* 0x0156 */
293 "CB_GETDROPPEDSTATE32", /* 0x0157 */
294 "CB_FINDSTRINGEXACT32", /* 0x0158 */
295 "CB_SETLOCALE32", /* 0x0159 */
296 "CB_GETLOCALE32", /* 0x015a */
297 "CB_GETTOPINDEX32", /* 0x015b */
298 "CB_SETTOPINDEX32", /* 0x015c */
299 "CB_GETHORIZONTALEXTENT32", /* 0x015d */
300 "CB_SETHORIZONTALEXTENT32", /* 0x015e */
301 "CB_GETDROPPEDWIDTH32", /* 0x015f */
303 "CB_SETDROPPEDWIDTH32", /* 0x0160 */
304 "CB_INITSTORAGE32", /* 0x0161 */
305 NULL, NULL, NULL, NULL, NULL, NULL,
306 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
308 /* 0x0170 - Win32 Static controls */
309 "STM_SETICON32", /* 0x0170 */
310 "STM_GETICON32", /* 0x0171 */
311 "STM_SETIMAGE32", /* 0x0172 */
312 "STM_GETIMAGE32", /* 0x0173 */
313 NULL, NULL, NULL, NULL,
314 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
316 /* 0x0180 - Win32 Listboxes */
317 "LB_ADDSTRING32", /* 0x0180 */
318 "LB_INSERTSTRING32", /* 0x0181 */
319 "LB_DELETESTRING32", /* 0x0182 */
320 "LB_SELITEMRANGEEX32", /* 0x0183 */
321 "LB_RESETCONTENT32", /* 0x0184 */
322 "LB_SETSEL32", /* 0x0185 */
323 "LB_SETCURSEL32", /* 0x0186 */
324 "LB_GETSEL32", /* 0x0187 */
325 "LB_GETCURSEL32", /* 0x0188 */
326 "LB_GETTEXT32", /* 0x0189 */
327 "LB_GETTEXTLEN32", /* 0x018a */
328 "LB_GETCOUNT32", /* 0x018b */
329 "LB_SELECTSTRING32", /* 0x018c */
330 "LB_DIR32", /* 0x018d */
331 "LB_GETTOPINDEX32", /* 0x018e */
332 "LB_FINDSTRING32", /* 0x018f */
334 "LB_GETSELCOUNT32", /* 0x0190 */
335 "LB_GETSELITEMS32", /* 0x0191 */
336 "LB_SETTABSTOPS32", /* 0x0192 */
337 "LB_GETHORIZONTALEXTENT32", /* 0x0193 */
338 "LB_SETHORIZONTALEXTENT32", /* 0x0194 */
339 "LB_SETCOLUMNWIDTH32", /* 0x0195 */
340 "LB_ADDFILE32", /* 0x0196 */
341 "LB_SETTOPINDEX32", /* 0x0197 */
342 "LB_GETITEMRECT32", /* 0x0198 */
343 "LB_GETITEMDATA32", /* 0x0199 */
344 "LB_SETITEMDATA32", /* 0x019a */
345 "LB_SELITEMRANGE32", /* 0x019b */
346 "LB_SETANCHORINDEX32", /* 0x019c */
347 "LB_GETANCHORINDEX32", /* 0x019d */
348 "LB_SETCARETINDEX32", /* 0x019e */
349 "LB_GETCARETINDEX32", /* 0x019f */
351 "LB_SETITEMHEIGHT32", /* 0x01a0 */
352 "LB_GETITEMHEIGHT32", /* 0x01a1 */
353 "LB_FINDSTRINGEXACT32", /* 0x01a2 */
354 "LB_CARETON32", /* 0x01a3 */
355 "LB_CARETOFF32", /* 0x01a4 */
356 "LB_SETLOCALE32", /* 0x01a5 */
357 "LB_GETLOCALE32", /* 0x01a6 */
358 "LB_SETCOUNT32", /* 0x01a7 */
359 "LB_INITSTORAGE32", /* 0x01a8 */
360 "LB_ITEMFROMPOINT32", /* 0x01a9 */
361 NULL, NULL, NULL, NULL, NULL, NULL,
363 /* 0x01B0 */
364 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
365 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
367 /* 0x01C0 */
368 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
369 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
371 /* 0x01D0 */
372 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
373 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
375 /* 0x01E0 */
376 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
377 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
379 /* 0x01F0 */
380 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
381 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
383 "WM_MOUSEMOVE", /* 0x0200 */
384 "WM_LBUTTONDOWN", /* 0x0201 */
385 "WM_LBUTTONUP", /* 0x0202 */
386 "WM_LBUTTONDBLCLK", /* 0x0203 */
387 "WM_RBUTTONDOWN", /* 0x0204 */
388 "WM_RBUTTONUP", /* 0x0205 */
389 "WM_RBUTTONDBLCLK", /* 0x0206 */
390 "WM_MBUTTONDOWN", /* 0x0207 */
391 "WM_MBUTTONUP", /* 0x0208 */
392 "WM_MBUTTONDBLCLK", /* 0x0209 */
393 "WM_MOUSEWHEEL", /* 0x020A */
394 NULL, NULL, NULL, NULL, NULL,
396 "WM_PARENTNOTIFY", /* 0x0210 */
397 "WM_ENTERMENULOOP", /* 0x0211 */
398 "WM_EXITMENULOOP", /* 0x0212 */
399 "WM_NEXTMENU", /* 0x0213 */
400 "WM_SIZING",
401 "WM_CAPTURECHANGED",
402 "WM_MOVING", NULL,
403 "WM_POWERBROADCAST",
404 "WM_DEVICECHANGE", NULL, NULL, NULL, NULL, NULL, NULL,
406 "WM_MDICREATE", /* 0x0220 */
407 "WM_MDIDESTROY", /* 0x0221 */
408 "WM_MDIACTIVATE", /* 0x0222 */
409 "WM_MDIRESTORE", /* 0x0223 */
410 "WM_MDINEXT", /* 0x0224 */
411 "WM_MDIMAXIMIZE", /* 0x0225 */
412 "WM_MDITILE", /* 0x0226 */
413 "WM_MDICASCADE", /* 0x0227 */
414 "WM_MDIICONARRANGE", /* 0x0228 */
415 "WM_MDIGETACTIVE", /* 0x0229 */
417 "WM_DROPOBJECT",
418 "WM_QUERYDROPOBJECT",
419 "WM_BEGINDRAG",
420 "WM_DRAGLOOP",
421 "WM_DRAGSELECT",
422 "WM_DRAGMOVE",
424 /* 0x0230*/
425 "WM_MDISETMENU", /* 0x0230 */
426 "WM_ENTERSIZEMOVE", /* 0x0231 */
427 "WM_EXITSIZEMOVE", /* 0x0232 */
428 "WM_DROPFILES", /* 0x0233 */
429 "WM_MDIREFRESHMENU", NULL, NULL, NULL,
430 /* 0x0238*/
431 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
433 /* 0x0240 */
434 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
435 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
437 /* 0x0250 */
438 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
439 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
441 /* 0x0260 */
442 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
443 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
444 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
445 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
447 /* 0x0280 */
448 NULL, "WM_IME_SETCONTEXT", "WM_IME_NOTIFY", "WM_IME_CONTROL", "WM_IME_COMPOSITIONFULL", "WM_IME_SELECT", "WM_IME_CHAR", NULL,
449 "WM_IME_REQUEST", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
450 "WM_IME_KEYDOWN", "WM_IME_KEYUP", NULL, NULL, NULL, NULL, NULL, NULL,
451 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
453 /* 0x02a0 */
454 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
455 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
456 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
457 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
459 /* 0x02c0 */
460 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
461 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
462 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
463 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
465 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
466 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
467 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
468 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
470 "WM_CUT", /* 0x0300 */
471 "WM_COPY",
472 "WM_PASTE",
473 "WM_CLEAR",
474 "WM_UNDO",
475 "WM_RENDERFORMAT",
476 "WM_RENDERALLFORMATS",
477 "WM_DESTROYCLIPBOARD",
478 "WM_DRAWCLIPBOARD",
479 "WM_PAINTCLIPBOARD",
480 "WM_VSCROLLCLIPBOARD",
481 "WM_SIZECLIPBOARD",
482 "WM_ASKCBFORMATNAME",
483 "WM_CHANGECBCHAIN",
484 "WM_HSCROLLCLIPBOARD",
485 "WM_QUERYNEWPALETTE", /* 0x030f*/
487 "WM_PALETTEISCHANGING",
488 "WM_PALETTECHANGED",
489 "WM_HOTKEY", /* 0x0312 */
490 NULL, NULL, NULL, NULL,
491 "WM_PRINT",
492 "WM_PRINTCLIENT",
493 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
495 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
496 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
497 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
498 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
500 /* 0x0340 */
501 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
502 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
503 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
504 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
506 "WM_QUERYAFXWNDPROC", /* 0x0360 */
507 "WM_SIZEPARENT", /* 0x0361 */
508 "WM_SETMESSAGESTRING", /* 0x0362 */
509 "WM_IDLEUPDATECMDUI", /* 0x0363 */
510 "WM_INITIALUPDATE", /* 0x0364 */
511 "WM_COMMANDHELP", /* 0x0365 */
512 "WM_HELPHITTEST", /* 0x0366 */
513 "WM_EXITHELPMODE", /* 0x0367 */
514 "WM_RECALCPARENT", /* 0x0368 */
515 "WM_SIZECHILD", /* 0x0369 */
516 "WM_KICKIDLE", /* 0x036A */
517 "WM_QUERYCENTERWND", /* 0x036B */
518 "WM_DISABLEMODAL", /* 0x036C */
519 "WM_FLOATSTATUS", /* 0x036D */
520 "WM_ACTIVATETOPLEVEL", /* 0x036E */
521 "WM_QUERY3DCONTROLS", /* 0x036F */
522 NULL,NULL,NULL,
523 "WM_SOCKET_NOTIFY", /* 0x0373 */
524 "WM_SOCKET_DEAD", /* 0x0374 */
525 "WM_POPMESSAGESTRING", /* 0x0375 */
526 "WM_OCC_LOADFROMSTREAM", /* 0x0376 */
527 "WM_OCC_LOADFROMSTORAGE", /* 0x0377 */
528 "WM_OCC_INITNEW", /* 0x0378 */
529 "WM_QUEUE_SENTINEL", /* 0x0379 */
530 "WM_OCC_LOADFROMSTREAM_EX", /* 0x037A */
531 "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */
533 NULL,NULL,NULL,NULL,
535 /* 0x0380 */
536 "WM_PENWINFIRST",
537 "WM_RCRESULT",
538 "WM_HOOKRCRESULT",
539 "WM_GLOBALRCCHANGE",
540 "WM_SKB",
541 "WM_HEDITCTL",
542 NULL, NULL,
543 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
545 "WM_COALESCE_FIRST",
546 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
547 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
548 "WM_COALESCE_LAST",
550 /* 0x03a0 */
551 "MM_JOY1MOVE",
552 "MM_JOY2MOVE",
553 "MM_JOY1ZMOVE",
554 "MM_JOY2ZMOVE",
555 NULL, NULL, NULL, NULL,
556 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
558 /* 0x03b0 */
559 NULL, NULL, NULL, NULL, NULL,
560 "MM_JOY1BUTTONDOWN",
561 "MM_JOY2BUTTONDOWN",
562 "MM_JOY1BUTTONUP",
563 "MM_JOY2BUTTONUP",
564 "MM_MCINOTIFY",
565 NULL,
566 "MM_WOM_OPEN",
567 "MM_WOM_CLOSE",
568 "MM_WOM_DONE",
569 "MM_WIM_OPEN",
570 "MM_WIM_CLOSE",
572 /* 0x03c0 */
573 "MM_WIM_DATA",
574 "MM_MIM_OPEN",
575 "MM_MIM_CLOSE",
576 "MM_MIM_DATA",
577 "MM_MIM_LONGDATA",
578 "MM_MIM_ERROR",
579 "MM_MIM_LONGERROR",
580 "MM_MOM_OPEN",
581 "MM_MOM_CLOSE",
582 "MM_MOM_DONE",
583 NULL, NULL, NULL, NULL, NULL, NULL,
584 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
585 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
587 /* 0x03e0 */
588 "WM_DDE_INITIATE", /* 0x3E0 */
589 "WM_DDE_TERMINATE", /* 0x3E1 */
590 "WM_DDE_ADVISE", /* 0x3E2 */
591 "WM_DDE_UNADVISE", /* 0x3E3 */
592 "WM_DDE_ACK", /* 0x3E4 */
593 "WM_DDE_DATA", /* 0x3E5 */
594 "WM_DDE_REQUEST", /* 0x3E6 */
595 "WM_DDE_POKE", /* 0x3E7 */
596 "WM_DDE_EXECUTE", /* 0x3E8 */
597 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
600 /* 0x03f0 */
601 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
602 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
604 "WM_USER"
608 #define SPY_MAX_LVMMSGNUM 140
609 static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] =
611 "LVM_GETBKCOLOR", /* 1000 */
612 "LVM_SETBKCOLOR",
613 "LVM_GETIMAGELIST",
614 "LVM_SETIMAGELIST",
615 "LVM_GETITEMCOUNT",
616 "LVM_GETITEMA",
617 "LVM_SETITEMA",
618 "LVM_INSERTITEMA",
619 "LVM_DELETEITEM",
620 "LVM_DELETEALLITEMS",
621 "LVM_GETCALLBACKMASK",
622 "LVM_SETCALLBACKMASK",
623 "LVM_GETNEXTITEM",
624 "LVM_FINDITEMA",
625 "LVM_GETITEMRECT",
626 "LVM_SETITEMPOSITION",
627 "LVM_GETITEMPOSITION",
628 "LVM_GETSTRINGWIDTHA",
629 "LVM_HITTEST",
630 "LVM_ENSUREVISIBLE",
631 "LVM_SCROLL",
632 "LVM_REDRAWITEMS",
633 "LVM_ARRANGE",
634 "LVM_EDITLABELA",
635 "LVM_GETEDITCONTROL",
636 "LVM_GETCOLUMNA",
637 "LVM_SETCOLUMNA",
638 "LVM_INSERTCOLUMNA",
639 "LVM_DELETECOLUMN",
640 "LVM_GETCOLUMNWIDTH",
641 "LVM_SETCOLUMNWIDTH",
642 "LVM_GETHEADER",
643 NULL,
644 "LVM_CREATEDRAGIMAGE",
645 "LVM_GETVIEWRECT",
646 "LVM_GETTEXTCOLOR",
647 "LVM_SETTEXTCOLOR",
648 "LVM_GETTEXTBKCOLOR",
649 "LVM_SETTEXTBKCOLOR",
650 "LVM_GETTOPINDEX",
651 "LVM_GETCOUNTPERPAGE",
652 "LVM_GETORIGIN",
653 "LVM_UPDATE",
654 "LVM_SETITEMSTATE",
655 "LVM_GETITEMSTATE",
656 "LVM_GETITEMTEXTA",
657 "LVM_SETITEMTEXTA",
658 "LVM_SETITEMCOUNT",
659 "LVM_SORTITEMS",
660 "LVM_SETITEMPOSITION32",
661 "LVM_GETSELECTEDCOUNT",
662 "LVM_GETITEMSPACING",
663 "LVM_GETISEARCHSTRINGA",
664 "LVM_SETICONSPACING",
665 "LVM_SETEXTENDEDLISTVIEWSTYLE",
666 "LVM_GETEXTENDEDLISTVIEWSTYLE",
667 "LVM_GETSUBITEMRECT",
668 "LVM_SUBITEMHITTEST",
669 "LVM_SETCOLUMNORDERARRAY",
670 "LVM_GETCOLUMNORDERARRAY",
671 "LVM_SETHOTITEM",
672 "LVM_GETHOTITEM",
673 "LVM_SETHOTCURSOR",
674 "LVM_GETHOTCURSOR",
675 "LVM_APPROXIMATEVIEWRECT",
676 "LVM_SETWORKAREAS",
677 "LVM_GETSELECTIONMARK",
678 "LVM_SETSELECTIONMARK",
679 "LVM_SETBKIMAGEA",
680 "LVM_GETBKIMAGEA",
681 "LVM_GETWORKAREAS",
682 "LVM_SETHOVERTIME",
683 "LVM_GETHOVERTIME",
684 "LVM_GETNUMBEROFWORKAREAS",
685 "LVM_SETTOOLTIPS",
686 "LVM_GETITEMW",
687 "LVM_SETITEMW",
688 "LVM_INSERTITEMW",
689 "LVM_GETTOOLTIPS",
690 NULL,
691 NULL,
692 NULL,
693 NULL,
694 "LVM_FINDITEMW",
695 NULL,
696 NULL,
697 NULL,
698 "LVM_GETSTRINGWIDTHW",
699 NULL,
700 NULL,
701 NULL,
702 NULL,
703 NULL,
704 NULL,
705 NULL,
706 "LVM_GETCOLUMNW",
707 "LVM_SETCOLUMNW",
708 "LVM_INSERTCOLUMNW",
709 NULL,
710 NULL,
711 NULL,
712 NULL,
713 NULL,
714 NULL,
715 NULL,
716 NULL,
717 NULL,
718 NULL,
719 NULL,
720 NULL,
721 NULL,
722 NULL,
723 NULL,
724 NULL,
725 NULL,
726 "LVM_GETITEMTEXTW",
727 "LVM_SETITEMTEXTW",
728 "LVM_GETISEARCHSTRINGW",
729 "LVM_EDITLABELW",
730 NULL,
731 NULL,
732 NULL,
733 NULL,
734 NULL,
735 NULL,
736 NULL,
737 NULL,
738 NULL,
739 NULL,
740 NULL,
741 NULL,
742 NULL,
743 NULL,
744 NULL,
745 NULL,
746 NULL,
747 NULL,
748 NULL,
749 NULL,
750 "LVM_SETBKIMAGEW",
751 "LVM_GETBKIMAGEW" /* 0x108B */
755 #define SPY_MAX_TVMSGNUM 65
756 static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] =
758 "TVM_INSERTITEMA", /* 1100 */
759 "TVM_DELETEITEM",
760 "TVM_EXPAND",
761 NULL,
762 "TVM_GETITEMRECT",
763 "TVM_GETCOUNT",
764 "TVM_GETINDENT",
765 "TVM_SETINDENT",
766 "TVM_GETIMAGELIST",
767 "TVM_SETIMAGELIST",
768 "TVM_GETNEXTITEM",
769 "TVM_SELECTITEM",
770 "TVM_GETITEMA",
771 "TVM_SETITEMA",
772 "TVM_EDITLABELA",
773 "TVM_GETEDITCONTROL",
774 "TVM_GETVISIBLECOUNT",
775 "TVM_HITTEST",
776 "TVM_CREATEDRAGIMAGE",
777 "TVM_SORTCHILDREN",
778 "TVM_ENSUREVISIBLE",
779 "TVM_SORTCHILDRENCB",
780 "TVM_ENDEDITLABELNOW",
781 "TVM_GETISEARCHSTRINGA",
782 "TVM_SETTOOLTIPS",
783 "TVM_GETTOOLTIPS",
784 "TVM_SETINSERTMARK",
785 "TVM_SETITEMHEIGHT",
786 "TVM_GETITEMHEIGHT",
787 "TVM_SETBKCOLOR",
788 "TVM_SETTEXTCOLOR",
789 "TVM_GETBKCOLOR",
790 "TVM_GETTEXTCOLOR",
791 "TVM_SETSCROLLTIME",
792 "TVM_GETSCROLLTIME",
793 "TVM_UNKNOWN35",
794 "TVM_UNKNOWN36",
795 "TVM_SETINSERTMARKCOLOR",
796 "TVM_GETINSERTMARKCOLOR",
797 "TVM_GETITEMSTATE",
798 "TVM_SETLINECOLOR",
799 "TVM_GETLINECOLOR",
800 NULL,
801 NULL,
802 NULL,
803 NULL,
804 NULL,
805 NULL,
806 NULL,
807 NULL,
808 "TVM_INSERTITEMW",
809 NULL,
810 NULL,
811 NULL,
812 NULL,
813 NULL,
814 NULL,
815 NULL,
816 NULL,
817 NULL,
818 NULL,
819 NULL,
820 "TVM_GETITEMW",
821 "TVM_SETITEMW",
822 "TVM_GETISEARCHSTRINGW",
823 "TVM_EDITLABELW"
827 #define SPY_MAX_HDMMSGNUM 19
828 static const char * const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM + 1] =
830 "HDM_GETITEMCOUNT", /* 1200 */
831 "HDM_INSERTITEMA",
832 "HDM_DELETEITEM",
833 "HDM_GETITEMA",
834 "HDM_SETITEMA",
835 "HDM_LAYOUT",
836 "HDM_HITTEST",
837 "HDM_GETITEMRECT",
838 "HDM_SETIMAGELIST",
839 "HDM_GETIMAGELIST",
840 "HDM_INSERTITEMW",
841 "HDM_GETITEMW",
842 "HDM_SETITEMW",
843 NULL,
844 NULL,
845 "HDM_ORDERTOINDEX",
846 "HDM_CREATEDRAGIMAGE",
847 "GETORDERARRAYINDEX",
848 "SETORDERARRAYINDEX",
849 "SETHOTDIVIDER"
853 #define SPY_MAX_TCMMSGNUM 62
854 static const char * const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM + 1] =
856 NULL, /* 1300 */
857 NULL,
858 "TCM_SETIMAGELIST",
859 "TCM_GETIMAGELIST",
860 "TCM_GETITEMCOUNT",
861 "TCM_GETITEMA",
862 "TCM_SETITEMA",
863 "TCM_INSERTITEMA",
864 "TCM_DELETEITEM",
865 "TCM_DELETEALLITEMS",
866 "TCM_GETITEMRECT",
867 "TCM_GETCURSEL",
868 "TCM_SETCURSEL",
869 "TCM_HITTEST",
870 "TCM_SETITEMEXTRA",
871 NULL,
872 NULL,
873 NULL,
874 NULL,
875 NULL,
876 NULL,
877 NULL,
878 NULL,
879 NULL,
880 NULL,
881 NULL,
882 NULL,
883 NULL,
884 NULL,
885 NULL,
886 NULL,
887 NULL,
888 NULL,
889 NULL,
890 NULL,
891 NULL,
892 NULL,
893 NULL,
894 NULL,
895 NULL,
896 "TCM_ADJUSTRECT",
897 "TCM_SETITEMSIZE",
898 "TCM_REMOVEIMAGE",
899 "TCM_SETPADDING",
900 "TCM_GETROWCOUNT",
901 "TCM_GETTOOLTIPS",
902 "TCM_SETTOOLTIPS",
903 "TCM_GETCURFOCUS",
904 "TCM_SETCURFOCUS",
905 "TCM_SETMINTABWIDTH",
906 "TCM_DESELECTALL",
907 "TCM_HIGHLIGHTITEM",
908 "TCM_SETEXTENDEDSTYLE",
909 "TCM_GETEXTENDEDSTYLE",
910 NULL,
911 NULL,
912 NULL,
913 NULL,
914 NULL,
915 NULL,
916 "TCM_GETITEMW",
917 "TCM_SETITEMW",
918 "TCM_INSERTITEMW"
921 #define SPY_MAX_PGMMSGNUM 13
922 static const char * const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM + 1] =
924 NULL, /* 1400 */
925 "PGM_SETCHILD",
926 "PGM_RECALCSIZE",
927 "PGM_FORWARDMOUSE",
928 "PGM_SETBKCOLOR",
929 "PGM_GETBKCOLOR",
930 "PGM_SETBORDER",
931 "PGM_GETBORDER",
932 "PGM_SETPOS",
933 "PGM_GETPOS",
934 "PGM_SETBUTTONSIZE",
935 "PGM_GETBUTTONSIZE",
936 "PGM_GETBUTTONSTATE",
937 "PGM_GETDROPTARGET"
941 #define SPY_MAX_CCMMSGNUM 6
942 static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] =
944 NULL, /* 0x2000 */
945 "CCM_SETBKCOLOR",
946 "CCM_SETCOLORSCHEME",
947 "CCM_GETCOLORSCHEME",
948 "CCM_GETDROPTARGET",
949 "CCM_SETUNICODEFORMAT",
950 "CCM_GETUNICODEFORMAT"
953 /* Virtual key names */
954 #define SPY_MAX_VKKEYSNUM 255
955 static const char * const VK_KeyNames[SPY_MAX_VKKEYSNUM + 1] =
957 NULL, /* 0x00 */
958 "VK_LBUTTON", /* 0x01 */
959 "VK_RBUTTON", /* 0x02 */
960 "VK_CANCEL", /* 0x03 */
961 "VK_MBUTTON", /* 0x04 */
962 NULL, /* 0x05 */
963 NULL, /* 0x06 */
964 NULL, /* 0x07 */
965 "VK_BACK", /* 0x08 */
966 "VK_TAB", /* 0x09 */
967 NULL, /* 0x0A */
968 NULL, /* 0x0B */
969 "VK_CLEAR", /* 0x0C */
970 "VK_RETURN", /* 0x0D */
971 NULL, /* 0x0E */
972 NULL, /* 0x0F */
973 "VK_SHIFT", /* 0x10 */
974 "VK_CONTROL", /* 0x11 */
975 "VK_MENU", /* 0x12 */
976 "VK_PAUSE", /* 0x13 */
977 "VK_CAPITAL", /* 0x14 */
978 NULL, /* 0x15 */
979 NULL, /* 0x16 */
980 NULL, /* 0x17 */
981 NULL, /* 0x18 */
982 NULL, /* 0x19 */
983 NULL, /* 0x1A */
984 "VK_ESCAPE", /* 0x1B */
985 NULL, /* 0x1C */
986 NULL, /* 0x1D */
987 NULL, /* 0x1E */
988 NULL, /* 0x1F */
989 "VK_SPACE", /* 0x20 */
990 "VK_PRIOR", /* 0x21 */
991 "VK_NEXT", /* 0x22 */
992 "VK_END", /* 0x23 */
993 "VK_HOME", /* 0x24 */
994 "VK_LEFT", /* 0x25 */
995 "VK_UP", /* 0x26 */
996 "VK_RIGHT", /* 0x27 */
997 "VK_DOWN", /* 0x28 */
998 "VK_SELECT", /* 0x29 */
999 "VK_PRINT", /* 0x2A */
1000 "VK_EXECUTE", /* 0x2B */
1001 "VK_SNAPSHOT", /* 0x2C */
1002 "VK_INSERT", /* 0x2D */
1003 "VK_DELETE", /* 0x2E */
1004 "VK_HELP", /* 0x2F */
1005 "VK_0", /* 0x30 */
1006 "VK_1", /* 0x31 */
1007 "VK_2", /* 0x32 */
1008 "VK_3", /* 0x33 */
1009 "VK_4", /* 0x34 */
1010 "VK_5", /* 0x35 */
1011 "VK_6", /* 0x36 */
1012 "VK_7", /* 0x37 */
1013 "VK_8", /* 0x38 */
1014 "VK_9", /* 0x39 */
1015 NULL, /* 0x3A */
1016 NULL, /* 0x3B */
1017 NULL, /* 0x3C */
1018 NULL, /* 0x3D */
1019 NULL, /* 0x3E */
1020 NULL, /* 0x3F */
1021 NULL, /* 0x40 */
1022 "VK_A", /* 0x41 */
1023 "VK_B", /* 0x42 */
1024 "VK_C", /* 0x43 */
1025 "VK_D", /* 0x44 */
1026 "VK_E", /* 0x45 */
1027 "VK_F", /* 0x46 */
1028 "VK_G", /* 0x47 */
1029 "VK_H", /* 0x48 */
1030 "VK_I", /* 0x49 */
1031 "VK_J", /* 0x4A */
1032 "VK_K", /* 0x4B */
1033 "VK_L", /* 0x4C */
1034 "VK_M", /* 0x4D */
1035 "VK_N", /* 0x4E */
1036 "VK_O", /* 0x4F */
1037 "VK_P", /* 0x50 */
1038 "VK_Q", /* 0x51 */
1039 "VK_R", /* 0x52 */
1040 "VK_S", /* 0x53 */
1041 "VK_T", /* 0x54 */
1042 "VK_U", /* 0x55 */
1043 "VK_V", /* 0x56 */
1044 "VK_W", /* 0x57 */
1045 "VK_X", /* 0x58 */
1046 "VK_Y", /* 0x59 */
1047 "VK_Z", /* 0x5A */
1048 "VK_LWIN", /* 0x5B */
1049 "VK_RWIN", /* 0x5C */
1050 "VK_APPS", /* 0x5D */
1051 NULL, /* 0x5E */
1052 NULL, /* 0x5F */
1053 "VK_NUMPAD0", /* 0x60 */
1054 "VK_NUMPAD1", /* 0x61 */
1055 "VK_NUMPAD2", /* 0x62 */
1056 "VK_NUMPAD3", /* 0x63 */
1057 "VK_NUMPAD4", /* 0x64 */
1058 "VK_NUMPAD5", /* 0x65 */
1059 "VK_NUMPAD6", /* 0x66 */
1060 "VK_NUMPAD7", /* 0x67 */
1061 "VK_NUMPAD8", /* 0x68 */
1062 "VK_NUMPAD9", /* 0x69 */
1063 "VK_MULTIPLY", /* 0x6A */
1064 "VK_ADD", /* 0x6B */
1065 "VK_SEPARATOR", /* 0x6C */
1066 "VK_SUBTRACT", /* 0x6D */
1067 "VK_DECIMAL", /* 0x6E */
1068 "VK_DIVIDE", /* 0x6F */
1069 "VK_F1", /* 0x70 */
1070 "VK_F2", /* 0x71 */
1071 "VK_F3", /* 0x72 */
1072 "VK_F4", /* 0x73 */
1073 "VK_F5", /* 0x74 */
1074 "VK_F6", /* 0x75 */
1075 "VK_F7", /* 0x76 */
1076 "VK_F8", /* 0x77 */
1077 "VK_F9", /* 0x78 */
1078 "VK_F10", /* 0x79 */
1079 "VK_F11", /* 0x7A */
1080 "VK_F12", /* 0x7B */
1081 "VK_F13", /* 0x7C */
1082 "VK_F14", /* 0x7D */
1083 "VK_F15", /* 0x7E */
1084 "VK_F16", /* 0x7F */
1085 "VK_F17", /* 0x80 */
1086 "VK_F18", /* 0x81 */
1087 "VK_F19", /* 0x82 */
1088 "VK_F20", /* 0x83 */
1089 "VK_F21", /* 0x84 */
1090 "VK_F22", /* 0x85 */
1091 "VK_F23", /* 0x86 */
1092 "VK_F24", /* 0x87 */
1093 NULL, /* 0x88 */
1094 NULL, /* 0x89 */
1095 NULL, /* 0x8A */
1096 NULL, /* 0x8B */
1097 NULL, /* 0x8C */
1098 NULL, /* 0x8D */
1099 NULL, /* 0x8E */
1100 NULL, /* 0x8F */
1101 "VK_NUMLOCK", /* 0x90 */
1102 "VK_SCROLL", /* 0x91 */
1103 NULL, /* 0x92 */
1104 NULL, /* 0x93 */
1105 NULL, /* 0x94 */
1106 NULL, /* 0x95 */
1107 NULL, /* 0x96 */
1108 NULL, /* 0x97 */
1109 NULL, /* 0x98 */
1110 NULL, /* 0x99 */
1111 NULL, /* 0x9A */
1112 NULL, /* 0x9B */
1113 NULL, /* 0x9C */
1114 NULL, /* 0x9D */
1115 NULL, /* 0x9E */
1116 NULL, /* 0x9F */
1117 "VK_LSHIFT", /* 0xA0 */
1118 "VK_RSHIFT", /* 0xA1 */
1119 "VK_LCONTROL", /* 0xA2 */
1120 "VK_RCONTROL", /* 0xA3 */
1121 "VK_LMENU", /* 0xA4 */
1122 "VK_RMENU", /* 0xA5 */
1123 NULL, /* 0xA6 */
1124 NULL, /* 0xA7 */
1125 NULL, /* 0xA8 */
1126 NULL, /* 0xA9 */
1127 NULL, /* 0xAA */
1128 NULL, /* 0xAB */
1129 NULL, /* 0xAC */
1130 NULL, /* 0xAD */
1131 NULL, /* 0xAE */
1132 NULL, /* 0xAF */
1133 NULL, /* 0xB0 */
1134 NULL, /* 0xB1 */
1135 NULL, /* 0xB2 */
1136 NULL, /* 0xB3 */
1137 NULL, /* 0xB4 */
1138 NULL, /* 0xB5 */
1139 NULL, /* 0xB6 */
1140 NULL, /* 0xB7 */
1141 NULL, /* 0xB8 */
1142 NULL, /* 0xB9 */
1143 "VK_OEM_1", /* 0xBA */
1144 "VK_OEM_PLUS", /* 0xBB */
1145 "VK_OEM_COMMA", /* 0xBC */
1146 "VK_OEM_MINUS", /* 0xBD */
1147 "VK_OEM_PERIOD", /* 0xBE */
1148 "VK_OEM_2", /* 0xBF */
1149 "VK_OEM_3", /* 0xC0 */
1150 NULL, /* 0xC1 */
1151 NULL, /* 0xC2 */
1152 NULL, /* 0xC3 */
1153 NULL, /* 0xC4 */
1154 NULL, /* 0xC5 */
1155 NULL, /* 0xC6 */
1156 NULL, /* 0xC7 */
1157 NULL, /* 0xC8 */
1158 NULL, /* 0xC9 */
1159 NULL, /* 0xCA */
1160 NULL, /* 0xCB */
1161 NULL, /* 0xCC */
1162 NULL, /* 0xCD */
1163 NULL, /* 0xCE */
1164 NULL, /* 0xCF */
1165 NULL, /* 0xD0 */
1166 NULL, /* 0xD1 */
1167 NULL, /* 0xD2 */
1168 NULL, /* 0xD3 */
1169 NULL, /* 0xD4 */
1170 NULL, /* 0xD5 */
1171 NULL, /* 0xD6 */
1172 NULL, /* 0xD7 */
1173 NULL, /* 0xD8 */
1174 NULL, /* 0xD9 */
1175 NULL, /* 0xDA */
1176 "VK_OEM_4", /* 0xDB */
1177 "VK_OEM_5", /* 0xDC */
1178 "VK_OEM_6", /* 0xDD */
1179 "VK_OEM_7", /* 0xDE */
1180 "VK_OEM_8", /* 0xDF */
1181 NULL, /* 0xE0 */
1182 "VK_OEM_AX", /* 0xE1 */
1183 "VK_OEM_102", /* 0xE2 */
1184 "VK_ICO_HELP", /* 0xE3 */
1185 "VK_ICO_00", /* 0xE4 */
1186 "VK_PROCESSKEY", /* 0xE5 */
1187 NULL, /* 0xE6 */
1188 NULL, /* 0xE7 */
1189 NULL, /* 0xE8 */
1190 NULL, /* 0xE9 */
1191 NULL, /* 0xEA */
1192 NULL, /* 0xEB */
1193 NULL, /* 0xEC */
1194 NULL, /* 0xED */
1195 NULL, /* 0xEE */
1196 NULL, /* 0xEF */
1197 NULL, /* 0xF0 */
1198 NULL, /* 0xF1 */
1199 NULL, /* 0xF2 */
1200 NULL, /* 0xF3 */
1201 NULL, /* 0xF4 */
1202 NULL, /* 0xF5 */
1203 "VK_ATTN", /* 0xF6 */
1204 "VK_CRSEL", /* 0xF7 */
1205 "VK_EXSEL", /* 0xF8 */
1206 "VK_EREOF", /* 0xF9 */
1207 "VK_PLAY", /* 0xFA */
1208 "VK_ZOOM", /* 0xFB */
1209 "VK_NONAME", /* 0xFC */
1210 "VK_PA1", /* 0xFD */
1211 "VK_OEM_CLEAR", /* 0xFE */
1212 NULL /* 0xFF */
1216 /* WM_NOTIFY function codes display */
1218 typedef struct
1220 const char *name; /* name of notify message */
1221 UINT value; /* notify code value */
1222 UINT len; /* length of extra space to dump */
1223 } SPY_NOTIFY;
1225 #define SPNFY(a,b) { #a ,a,sizeof(b)-sizeof(NMHDR)}
1227 /* Array MUST be in descending order by the 'value' field */
1228 /* (since value is UNSIGNED, 0xffffffff is largest and */
1229 /* 0xfffffffe is smaller). A binary search is used to */
1230 /* locate the correct 'value'. */
1231 static const SPY_NOTIFY spnfy_array[] = {
1232 /* common 0U to 0U-99U */
1233 SPNFY(NM_OUTOFMEMORY, NMHDR),
1234 SPNFY(NM_CLICK, NMHDR),
1235 SPNFY(NM_DBLCLK, NMHDR),
1236 SPNFY(NM_RETURN, NMHDR),
1237 SPNFY(NM_RCLICK, NMHDR),
1238 SPNFY(NM_RDBLCLK, NMHDR),
1239 SPNFY(NM_SETFOCUS, NMHDR),
1240 SPNFY(NM_KILLFOCUS, NMHDR),
1241 SPNFY(NM_CUSTOMDRAW, NMCUSTOMDRAW),
1242 SPNFY(NM_HOVER, NMHDR),
1243 SPNFY(NM_NCHITTEST, NMHDR),
1244 SPNFY(NM_KEYDOWN, NMKEY),
1245 SPNFY(NM_RELEASEDCAPTURE, NMHDR),
1246 SPNFY(NM_SETCURSOR, NMMOUSE),
1247 SPNFY(NM_CHAR, NMCHAR),
1248 SPNFY(NM_TOOLTIPSCREATED, NMTOOLTIPSCREATED),
1249 /* Listview 0U-100U to 0U-199U */
1250 SPNFY(LVN_ITEMCHANGING, NMHDR),
1251 SPNFY(LVN_ITEMCHANGED, NMHDR),
1252 SPNFY(LVN_INSERTITEM, NMHDR),
1253 SPNFY(LVN_DELETEITEM, NMHDR),
1254 SPNFY(LVN_DELETEALLITEMS, NMHDR),
1255 SPNFY(LVN_BEGINLABELEDITA, NMHDR),
1256 SPNFY(LVN_ENDLABELEDITA, NMHDR),
1257 SPNFY(LVN_COLUMNCLICK, NMHDR),
1258 SPNFY(LVN_BEGINDRAG, NMHDR),
1259 SPNFY(LVN_BEGINRDRAG, NMHDR),
1260 SPNFY(LVN_ODCACHEHINT, NMHDR),
1261 SPNFY(LVN_ITEMACTIVATE, NMHDR),
1262 SPNFY(LVN_ODSTATECHANGED, NMHDR),
1263 SPNFY(LVN_HOTTRACK, NMHDR),
1264 SPNFY(LVN_GETDISPINFOA, NMHDR),
1265 SPNFY(LVN_SETDISPINFOA, NMHDR),
1266 SPNFY(LVN_KEYDOWN, NMHDR),
1267 SPNFY(LVN_MARQUEEBEGIN, NMHDR),
1268 SPNFY(LVN_GETINFOTIPA, NMHDR),
1269 SPNFY(LVN_GETINFOTIPW, NMHDR),
1270 SPNFY(LVN_BEGINLABELEDITW, NMHDR),
1271 SPNFY(LVN_ENDLABELEDITW, NMHDR),
1272 SPNFY(LVN_GETDISPINFOW, NMHDR),
1273 SPNFY(LVN_SETDISPINFOW, NMHDR),
1274 SPNFY(LVN_ODFINDITEMW, NMHDR),
1275 /* Header 0U-300U to 0U-399U */
1276 SPNFY(HDN_ITEMCHANGINGA, NMHDR),
1277 SPNFY(HDN_ITEMCHANGEDA, NMHDR),
1278 SPNFY(HDN_ITEMCLICKA, NMHDR),
1279 SPNFY(HDN_ITEMDBLCLICKA, NMHDR),
1280 SPNFY(HDN_DIVIDERDBLCLICKA, NMHDR),
1281 SPNFY(HDN_BEGINTRACKA, NMHDR),
1282 SPNFY(HDN_ENDTRACKA, NMHDR),
1283 SPNFY(HDN_GETDISPINFOA, NMHDR),
1284 SPNFY(HDN_BEGINDRAG, NMHDR),
1285 SPNFY(HDN_ENDDRAG, NMHDR),
1286 SPNFY(HDN_ITEMCHANGINGW, NMHDR),
1287 SPNFY(HDN_ITEMCHANGEDW, NMHDR),
1288 SPNFY(HDN_ITEMCLICKW, NMHDR),
1289 SPNFY(HDN_ITEMDBLCLICKW, NMHDR),
1290 SPNFY(HDN_DIVIDERDBLCLICKW, NMHDR),
1291 SPNFY(HDN_BEGINTRACKW, NMHDR),
1292 SPNFY(HDN_ENDTRACKW, NMHDR),
1293 SPNFY(HDN_GETDISPINFOW, NMHDR),
1294 /* Treeview 0U-400U to 0U-499U */
1295 SPNFY(TVN_SELCHANGINGA, NMHDR),
1296 SPNFY(TVN_SELCHANGEDA, NMHDR),
1297 SPNFY(TVN_GETDISPINFOA, NMHDR),
1298 SPNFY(TVN_SETDISPINFOA, NMHDR),
1299 SPNFY(TVN_ITEMEXPANDINGA, NMHDR),
1300 SPNFY(TVN_ITEMEXPANDEDA, NMHDR),
1301 SPNFY(TVN_BEGINDRAGA, NMHDR),
1302 SPNFY(TVN_BEGINRDRAGA, NMHDR),
1303 SPNFY(TVN_DELETEITEMA, NMHDR),
1304 SPNFY(TVN_BEGINLABELEDITA, NMHDR),
1305 SPNFY(TVN_ENDLABELEDITA, NMHDR),
1306 SPNFY(TVN_KEYDOWN, NMHDR),
1307 SPNFY(TVN_SELCHANGINGW, NMHDR),
1308 SPNFY(TVN_SELCHANGEDW, NMHDR),
1309 SPNFY(TVN_GETDISPINFOW, NMHDR),
1310 SPNFY(TVN_SETDISPINFOW, NMHDR),
1311 SPNFY(TVN_ITEMEXPANDINGW, NMHDR),
1312 SPNFY(TVN_ITEMEXPANDEDW, NMHDR),
1313 SPNFY(TVN_BEGINDRAGW, NMHDR),
1314 SPNFY(TVN_BEGINRDRAGW, NMHDR),
1315 SPNFY(TVN_DELETEITEMW, NMHDR),
1316 SPNFY(TVN_BEGINLABELEDITW, NMHDR),
1317 SPNFY(TVN_ENDLABELEDITW, NMHDR),
1318 /* Tooltips 0U-520U to 0U-549U */
1319 /* Tab 0U-550U to 0U-580U */
1320 SPNFY(TCN_KEYDOWN, NMHDR),
1321 SPNFY(TCN_SELCHANGE, NMHDR),
1322 SPNFY(TCN_SELCHANGING, NMHDR),
1323 SPNFY(TCN_GETOBJECT, NMHDR),
1324 /* Common Dialog 0U-601U to 0U-699U */
1325 /* Toolbar 0U-700U to 0U-720U */
1326 SPNFY(TBN_GETBUTTONINFOA, NMTOOLBARA),
1327 SPNFY(TBN_BEGINDRAG, NMTOOLBARA),
1328 SPNFY(TBN_ENDDRAG, NMTOOLBARA),
1329 SPNFY(TBN_BEGINADJUST, NMHDR),
1330 SPNFY(TBN_ENDADJUST, NMHDR),
1331 SPNFY(TBN_RESET, NMHDR),
1332 SPNFY(TBN_QUERYINSERT, NMTOOLBARA),
1333 SPNFY(TBN_QUERYDELETE, NMTOOLBARA),
1334 SPNFY(TBN_TOOLBARCHANGE, NMHDR),
1335 SPNFY(TBN_CUSTHELP, NMHDR),
1336 SPNFY(TBN_DROPDOWN, NMTOOLBARA),
1337 SPNFY(TBN_GETOBJECT, NMOBJECTNOTIFY),
1338 SPNFY(TBN_HOTITEMCHANGE, NMHDR), /* NMTBHOTITEM), */
1339 SPNFY(TBN_DRAGOUT, NMTOOLBARA),
1340 SPNFY(TBN_DELETINGBUTTON, NMTOOLBARA),
1341 SPNFY(TBN_GETDISPINFOA, NMHDR), /* NMTBDISPINFO), */
1342 SPNFY(TBN_GETDISPINFOW, NMHDR), /* NMTBDISPINFO), */
1343 SPNFY(TBN_GETINFOTIPA, NMTBGETINFOTIPA),
1344 SPNFY(TBN_GETINFOTIPW, NMTBGETINFOTIPW),
1345 SPNFY(TBN_GETBUTTONINFOW, NMTOOLBARW),
1346 /* Up/Down 0U-721U to 0U-740U */
1347 /* Month Calendar 0U-750U to 0U-759U */
1348 /* Date/Time 0U-760U to 0U-799U */
1349 /* ComboBoxEx 0U-800U to 0U-830U */
1350 SPNFY(CBEN_GETDISPINFOA, NMHDR), /* NMCOMBOBOXEX), */
1351 SPNFY(CBEN_INSERTITEM, NMHDR), /* NMCOMBOBOXEX), */
1352 SPNFY(CBEN_DELETEITEM, NMHDR), /* NMCOMBOBOXEX), */
1353 SPNFY(CBEN_BEGINEDIT, NMHDR),
1354 SPNFY(CBEN_ENDEDITA, NMCBEENDEDITA),
1355 SPNFY(CBEN_ENDEDITW, NMCBEENDEDITW),
1356 SPNFY(CBEN_GETDISPINFOW, NMHDR), /* NMCOMBOBOXEXW), */
1357 SPNFY(CBEN_DRAGBEGINA, NMHDR), /* NMCBEDRAGBEGINA), */
1358 SPNFY(CBEN_DRAGBEGINW, NMHDR), /* NMCBEDRAGBEGINW), */
1359 /* Rebar 0U-831U to 0U-859U */
1360 SPNFY(RBN_HEIGHTCHANGE, NMHDR),
1361 SPNFY(RBN_GETOBJECT, NMOBJECTNOTIFY),
1362 SPNFY(RBN_LAYOUTCHANGED, NMHDR),
1363 SPNFY(RBN_AUTOSIZE, NMRBAUTOSIZE),
1364 SPNFY(RBN_BEGINDRAG, NMREBAR),
1365 SPNFY(RBN_ENDDRAG, NMREBAR),
1366 SPNFY(RBN_DELETINGBAND, NMREBAR),
1367 SPNFY(RBN_DELETEDBAND, NMREBAR),
1368 SPNFY(RBN_CHILDSIZE, NMREBARCHILDSIZE),
1369 /* IP Adderss 0U-860U to 0U-879U */
1370 /* Status bar 0U-880U to 0U-899U */
1371 /* Pager 0U-900U to 0U-950U */
1372 {0,0,0}};
1373 static const SPY_NOTIFY *end_spnfy_array; /* ptr to last good entry in array */
1374 #undef SPNFY
1377 static BOOL16 SPY_Exclude[SPY_MAX_MSGNUM+1];
1378 static BOOL16 SPY_ExcludeDWP = 0;
1379 static int SPY_IndentLevel = 0;
1381 #define SPY_EXCLUDE(msg) \
1382 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
1384 /***********************************************************************
1385 * SPY_GetMsgName
1387 const char *SPY_GetMsgName( UINT msg )
1389 static char msg_buffer[20];
1391 if (msg <= SPY_MAX_MSGNUM)
1393 if (!MessageTypeNames[msg]) return "???";
1394 return MessageTypeNames[msg];
1397 if (msg >= LVM_FIRST && msg <= LVM_FIRST + SPY_MAX_LVMMSGNUM)
1399 if (!LVMMessageTypeNames[msg-LVM_FIRST]) return "LVM_?";
1400 return LVMMessageTypeNames[msg-LVM_FIRST];
1403 if (msg >= TV_FIRST && msg <= TV_FIRST + SPY_MAX_TVMSGNUM)
1405 if (!TVMessageTypeNames[msg-TV_FIRST]) return "TV_?";
1406 return TVMessageTypeNames[msg-TV_FIRST];
1409 if (msg >= HDM_FIRST && msg <= HDM_FIRST + SPY_MAX_HDMMSGNUM)
1411 if (!HDMMessageTypeNames[msg-HDM_FIRST]) return "HDM_?";
1412 return HDMMessageTypeNames[msg-HDM_FIRST];
1415 if (msg >= TCM_FIRST && msg <= TCM_FIRST + SPY_MAX_TCMMSGNUM)
1417 if (!TCMMessageTypeNames[msg-TCM_FIRST]) return "TCM_?";
1418 return TCMMessageTypeNames[msg-TCM_FIRST];
1421 if (msg >= PGM_FIRST && msg <= PGM_FIRST + SPY_MAX_PGMMSGNUM)
1423 if (!PGMMessageTypeNames[msg-PGM_FIRST]) return "PGM_?";
1424 return PGMMessageTypeNames[msg-PGM_FIRST];
1427 if (msg >= CCM_FIRST && msg <= CCM_FIRST + SPY_MAX_CCMMSGNUM)
1429 if (!CCMMessageTypeNames[msg-CCM_FIRST]) return "???";
1430 return CCMMessageTypeNames[msg-CCM_FIRST];
1433 sprintf( msg_buffer, "WM_USER+%04x", msg - WM_USER );
1434 return msg_buffer;
1437 /***********************************************************************
1438 * SPY_GetWndName
1440 const char *SPY_GetWndName( HWND hwnd )
1442 static char wnd_buffer[16];
1444 WND* pWnd = WIN_FindWndPtr( hwnd );
1445 if( pWnd )
1447 INT n = sizeof(wnd_buffer) - 6;
1448 LPSTR p = wnd_buffer;
1449 char postfix;
1451 if( pWnd->text && pWnd->text[0] != '\0' )
1453 LPWSTR src = pWnd->text;
1454 *(p++) = postfix = '\"';
1455 while ((n-- > 1) && *src) *p++ = *src++;
1456 if( *src ) for( n = 0; n < 3; n++ ) *(p++)='.';
1458 else /* get class name */
1460 *(p++)='{';
1461 GlobalGetAtomNameA((ATOM) GetClassWord(pWnd->hwndSelf, GCW_ATOM), p, n + 1);
1462 p += strlen(p);
1463 postfix = '}';
1465 *(p++) = postfix;
1466 *(p++) = '\0';
1467 WIN_ReleaseWndPtr(pWnd);
1470 else strcpy( wnd_buffer, "\"NULL\"" );
1471 return wnd_buffer;
1474 /***********************************************************************
1475 * SPY_GetVKeyName
1477 const char *SPY_GetVKeyName(WPARAM wParam)
1479 const char *vk_key_name;
1481 if(wParam <= SPY_MAX_VKKEYSNUM && VK_KeyNames[wParam])
1482 vk_key_name = VK_KeyNames[wParam];
1483 else
1484 vk_key_name = "VK_???";
1486 return vk_key_name;
1489 /***********************************************************************
1490 * SPY_Bsearch_Notify
1492 const SPY_NOTIFY *SPY_Bsearch_Notify( const SPY_NOTIFY *first, const SPY_NOTIFY *last, UINT code)
1494 INT count;
1495 const SPY_NOTIFY *test;
1497 while (last >= first) {
1498 count = 1 + last - first;
1499 if (count < 3) {
1500 /* TRACE("code=%d, f-value=%d, f-name=%s, l-value=%d, l-name=%s, l-len=%d,\n",
1501 code, first->value, first->name, last->value, last->name, last->len); */
1502 if (first->value == code) return first;
1503 if (last->value == code) return last;
1504 return NULL;
1506 count = count / 2;
1507 test = first + count;
1508 /* TRACE("first=%p, last=%p, test=%p, t-value=%d, code=%d, count=%d\n",
1509 first, last, test, test->value, code, count); */
1510 if (test->value == code) return test;
1511 if (test->value < code)
1512 last = test - 1;
1513 else
1514 first = test + 1;
1516 return NULL;
1519 /***********************************************************************
1520 * SPY_DumpStructure
1522 void SPY_DumpStructure (UINT msg, BOOL enter, LPARAM structure)
1524 switch (msg)
1526 case WM_DRAWITEM:
1527 if (!enter) break;
1529 DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) structure;
1530 TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
1531 lpdis->CtlType, lpdis->CtlID);
1532 TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
1533 lpdis->itemID, lpdis->itemAction, lpdis->itemState);
1534 TRACE("hWnd=0x%04x hDC=0x%04x (%d,%d)-(%d,%d) itemData=0x%08lx\n",
1535 lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left,
1536 lpdis->rcItem.top, lpdis->rcItem.right,
1537 lpdis->rcItem.bottom, lpdis->itemData);
1539 break;
1540 case WM_MEASUREITEM:
1542 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) structure;
1543 TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
1544 lpmis->CtlType, lpmis->CtlID);
1545 TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n",
1546 lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight);
1547 TRACE("itemData=0x%08lx\n", lpmis->itemData);
1549 break;
1550 case WM_WINDOWPOSCHANGED:
1551 if (!enter) break;
1552 case WM_WINDOWPOSCHANGING:
1554 WINDOWPOS *lpwp = (WINDOWPOS *)structure;
1555 TRACE("WINDOWPOS hwnd=0x%04x, after=0x%04x, at (%d,%d) h=%d w=%d, flags=0x%08x\n",
1556 lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y,
1557 lpwp->cx, lpwp->cy, lpwp->flags);
1559 break;
1560 case WM_STYLECHANGED:
1561 if (!enter) break;
1562 case WM_STYLECHANGING:
1564 LPSTYLESTRUCT ss = (LPSTYLESTRUCT) structure;
1565 TRACE("STYLESTRUCT: StyleOld=0x%08lx, StyleNew=0x%08lx\n",
1566 ss->styleOld, ss->styleNew);
1568 break;
1569 case WM_NOTIFY:
1570 if (!enter) break;
1572 NMHDR * pnmh = (NMHDR*) structure;
1573 UINT *q;
1574 const SPY_NOTIFY *p;
1576 p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array,
1577 pnmh->code);
1578 if (p) {
1579 TRACE("NMHDR hwndFrom=0x%08x idFrom=0x%08x code=%s<0x%08x>, extra=0x%x\n",
1580 pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len);
1581 if (p->len > 0) {
1582 int i;
1583 q = (UINT *)(pnmh + 1);
1584 for(i=0; i<((INT)p->len)-12; i+=16) {
1585 TRACE("NM extra [%04x] %08x %08x %08x %08x\n",
1586 i, *q, *(q+1), *(q+2), *(q+3));
1587 q += 4;
1589 switch (p->len - i) {
1590 case 12:
1591 TRACE("NM extra [%04x] %08x %08x %08x\n",
1592 i, *q, *(q+1), *(q+2));
1593 break;
1594 case 8:
1595 TRACE("NM extra [%04x] %08x %08x\n",
1596 i, *q, *(q+1));
1597 break;
1598 case 4:
1599 TRACE("NM extra [%04x] %08x\n",
1600 i, *q);
1601 break;
1602 default:
1603 break;
1607 else
1608 TRACE("NMHDR hwndFrom=0x%08x idFrom=0x%08x code=0x%08x\n",
1609 pnmh->hwndFrom, pnmh->idFrom, pnmh->code);
1611 default:
1612 break;
1616 /***********************************************************************
1617 * SPY_EnterMessage
1619 void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
1620 WPARAM wParam, LPARAM lParam )
1622 LPCSTR pname;
1624 if (!TRACE_ON(message) || SPY_EXCLUDE(msg)) return;
1626 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
1627 switch(iFlag)
1629 case SPY_DISPATCHMESSAGE16:
1630 pname = SPY_GetWndName(hWnd);
1631 TRACE("%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
1632 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
1633 wParam, lParam);
1634 break;
1636 case SPY_DISPATCHMESSAGE:
1637 pname = SPY_GetWndName(hWnd);
1638 TRACE("%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
1639 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
1640 wParam, lParam);
1641 break;
1643 case SPY_SENDMESSAGE16:
1644 case SPY_SENDMESSAGE:
1646 char taskName[30];
1647 HTASK16 hTask = GetWindowTask16(hWnd);
1649 if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
1650 else if (!hTask) strcpy( taskName, "Wine" );
1651 else
1653 sprintf( taskName, "task %04x ???", hTask );
1654 GetModuleName16( hTask, taskName + 10, sizeof(taskName) - 10 );
1656 pname = SPY_GetWndName(hWnd);
1658 if (iFlag == SPY_SENDMESSAGE16)
1659 TRACE("%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
1660 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
1661 taskName, wParam, lParam );
1662 else
1663 { TRACE("%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
1664 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
1665 taskName, wParam, lParam );
1666 SPY_DumpStructure(msg, TRUE, lParam);
1669 break;
1671 case SPY_DEFWNDPROC16:
1672 if( SPY_ExcludeDWP ) return;
1673 TRACE("%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
1674 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
1675 msg, wParam, lParam );
1676 break;
1678 case SPY_DEFWNDPROC:
1679 if( SPY_ExcludeDWP ) return;
1680 TRACE("%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
1681 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
1682 msg, wParam, lParam );
1683 break;
1685 SPY_IndentLevel += SPY_INDENT_UNIT;
1689 /***********************************************************************
1690 * SPY_ExitMessage
1692 void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
1693 WPARAM wParam, LPARAM lParam )
1695 LPCSTR pname;
1697 if (!TRACE_ON(message) || SPY_EXCLUDE(msg) ||
1698 (SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND)) )
1699 return;
1701 if (SPY_IndentLevel) SPY_IndentLevel -= SPY_INDENT_UNIT;
1703 switch(iFlag)
1705 case SPY_RESULT_DEFWND16:
1706 TRACE(" %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
1707 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
1708 break;
1710 case SPY_RESULT_DEFWND:
1711 TRACE(" %*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
1712 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
1713 break;
1715 case SPY_RESULT_OK16:
1716 pname = SPY_GetWndName(hWnd);
1717 TRACE(" %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
1718 SPY_IndentLevel, "", hWnd, pname, msg,
1719 SPY_GetMsgName( msg ), lReturn );
1720 break;
1722 case SPY_RESULT_OK:
1723 pname = SPY_GetWndName(hWnd);
1724 TRACE(" %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
1725 SPY_IndentLevel, "", hWnd, pname, msg,
1726 SPY_GetMsgName( msg ), lReturn );
1727 SPY_DumpStructure(msg, FALSE, lParam);
1728 break;
1730 case SPY_RESULT_INVALIDHWND16:
1731 pname = SPY_GetWndName(hWnd);
1732 WARN(" %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
1733 SPY_IndentLevel, "", hWnd, pname, msg,
1734 SPY_GetMsgName( msg ) );
1735 break;
1737 case SPY_RESULT_INVALIDHWND:
1738 pname = SPY_GetWndName(hWnd);
1739 WARN(" %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
1740 SPY_IndentLevel, "", hWnd, pname, msg,
1741 SPY_GetMsgName( msg ) );
1742 break;
1747 /***********************************************************************
1748 * SPY_Init
1750 int SPY_Init(void)
1752 int i;
1753 char buffer[1024];
1754 const SPY_NOTIFY *p;
1756 if (!TRACE_ON(message)) return TRUE;
1758 PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) );
1759 if (buffer[0] && strcmp( buffer, "INCLUDEALL" ))
1761 TRACE("Include=%s\n", buffer );
1762 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
1763 SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
1766 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) );
1767 if (buffer[0])
1769 TRACE("Exclude=%s\n", buffer );
1770 if (!strcmp( buffer, "EXCLUDEALL" ))
1771 for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = TRUE;
1772 else
1773 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
1774 SPY_Exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i]));
1777 SPY_ExcludeDWP = PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 );
1779 /* find last good entry in spy notify array and save addr for b-search */
1780 p = &spnfy_array[0];
1781 while (p->name) p++;
1782 p--;
1783 end_spnfy_array = p;
1785 return 1;