d3d11: Report D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW in CheckFormatSupport().
[wine.git] / dlls / user32 / spy.c
blob727094be05dae72611b7eac40b030592694ea337
1 /*
2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
5 * 1995, Alex Korobka
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <stdlib.h>
23 #include <string.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winreg.h"
30 #include "win.h"
31 #include "user_private.h"
32 #include "wine/debug.h"
33 #include "commctrl.h"
34 #include "commdlg.h"
35 #include "richedit.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(message);
39 #define SPY_MAX_MSGNUM WM_USER
40 #define SPY_INDENT_UNIT 4 /* 4 spaces */
42 #define DEBUG_SPY 0
44 static const char * const ClassLongOffsetNames[] =
46 "GCLP_MENUNAME", /* -8 */
47 "GCLP_HBRBACKGROUND", /* -10 */
48 "GCLP_HCURSOR", /* -12 */
49 "GCLP_HICON", /* -14 */
50 "GCLP_HMODULE", /* -16 */
51 "GCL_CBWNDEXTRA", /* -18 */
52 "GCL_CBCLSEXTRA", /* -20 */
53 "?",
54 "GCLP_WNDPROC", /* -24 */
55 "GCL_STYLE", /* -26 */
56 "?",
57 "?",
58 "GCW_ATOM", /* -32 */
59 "GCLP_HICONSM", /* -34 */
62 static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
64 "WM_NULL", /* 0x00 */
65 "WM_CREATE",
66 "WM_DESTROY",
67 "WM_MOVE",
68 "wm_sizewait",
69 "WM_SIZE",
70 "WM_ACTIVATE",
71 "WM_SETFOCUS",
72 "WM_KILLFOCUS",
73 "WM_SETVISIBLE",
74 "WM_ENABLE",
75 "WM_SETREDRAW",
76 "WM_SETTEXT",
77 "WM_GETTEXT",
78 "WM_GETTEXTLENGTH",
79 "WM_PAINT",
80 "WM_CLOSE", /* 0x10 */
81 "WM_QUERYENDSESSION",
82 "WM_QUIT",
83 "WM_QUERYOPEN",
84 "WM_ERASEBKGND",
85 "WM_SYSCOLORCHANGE",
86 "WM_ENDSESSION",
87 "wm_systemerror",
88 "WM_SHOWWINDOW",
89 "WM_CTLCOLOR",
90 "WM_WININICHANGE",
91 "WM_DEVMODECHANGE",
92 "WM_ACTIVATEAPP",
93 "WM_FONTCHANGE",
94 "WM_TIMECHANGE",
95 "WM_CANCELMODE",
96 "WM_SETCURSOR", /* 0x20 */
97 "WM_MOUSEACTIVATE",
98 "WM_CHILDACTIVATE",
99 "WM_QUEUESYNC",
100 "WM_GETMINMAXINFO",
101 "wm_unused3",
102 "wm_painticon",
103 "WM_ICONERASEBKGND",
104 "WM_NEXTDLGCTL",
105 "wm_alttabactive",
106 "WM_SPOOLERSTATUS",
107 "WM_DRAWITEM",
108 "WM_MEASUREITEM",
109 "WM_DELETEITEM",
110 "WM_VKEYTOITEM",
111 "WM_CHARTOITEM",
112 "WM_SETFONT", /* 0x30 */
113 "WM_GETFONT",
114 "WM_SETHOTKEY",
115 "WM_GETHOTKEY",
116 "wm_filesyschange",
117 "wm_isactiveicon",
118 "wm_queryparkicon",
119 "WM_QUERYDRAGICON",
120 "wm_querysavestate",
121 "WM_COMPAREITEM",
122 "wm_testing",
123 NULL,
124 NULL,
125 "WM_GETOBJECT", /* 0x3d */
126 "wm_activateshellwindow",
127 NULL,
129 NULL, /* 0x40 */
130 "wm_compacting", NULL, NULL,
131 "WM_COMMNOTIFY", NULL,
132 "WM_WINDOWPOSCHANGING", /* 0x0046 */
133 "WM_WINDOWPOSCHANGED", /* 0x0047 */
134 "WM_POWER", NULL,
135 "WM_COPYDATA",
136 "WM_CANCELJOURNAL", NULL, NULL,
137 "WM_NOTIFY", NULL,
139 /* 0x0050 */
140 "WM_INPUTLANGCHANGEREQUEST",
141 "WM_INPUTLANGCHANGE",
142 "WM_TCARD",
143 "WM_HELP",
144 "WM_USERCHANGED",
145 "WM_NOTIFYFORMAT", NULL, NULL,
146 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
148 /* 0x0060 */
149 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
150 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
152 /* 0x0070 */
153 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
154 NULL, NULL, NULL,
155 "WM_CONTEXTMENU",
156 "WM_STYLECHANGING",
157 "WM_STYLECHANGED",
158 "WM_DISPLAYCHANGE",
159 "WM_GETICON",
161 "WM_SETICON", /* 0x0080 */
162 "WM_NCCREATE", /* 0x0081 */
163 "WM_NCDESTROY", /* 0x0082 */
164 "WM_NCCALCSIZE", /* 0x0083 */
165 "WM_NCHITTEST", /* 0x0084 */
166 "WM_NCPAINT", /* 0x0085 */
167 "WM_NCACTIVATE", /* 0x0086 */
168 "WM_GETDLGCODE", /* 0x0087 */
169 "WM_SYNCPAINT",
170 "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL,
172 /* 0x0090 */
173 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
174 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
176 /* 0x00A0 */
177 "WM_NCMOUSEMOVE", /* 0x00a0 */
178 "WM_NCLBUTTONDOWN", /* 0x00a1 */
179 "WM_NCLBUTTONUP", /* 0x00a2 */
180 "WM_NCLBUTTONDBLCLK", /* 0x00a3 */
181 "WM_NCRBUTTONDOWN", /* 0x00a4 */
182 "WM_NCRBUTTONUP", /* 0x00a5 */
183 "WM_NCRBUTTONDBLCLK", /* 0x00a6 */
184 "WM_NCMBUTTONDOWN", /* 0x00a7 */
185 "WM_NCMBUTTONUP", /* 0x00a8 */
186 "WM_NCMBUTTONDBLCLK", /* 0x00a9 */
187 NULL, /* 0x00aa */
188 "WM_NCXBUTTONDOWN", /* 0x00ab */
189 "WM_NCXBUTTONUP", /* 0x00ac */
190 "WM_NCXBUTTONDBLCLK", /* 0x00ad */
191 NULL, /* 0x00ae */
192 NULL, /* 0x00af */
194 /* 0x00B0 - Win32 Edit controls */
195 "EM_GETSEL", /* 0x00b0 */
196 "EM_SETSEL", /* 0x00b1 */
197 "EM_GETRECT", /* 0x00b2 */
198 "EM_SETRECT", /* 0x00b3 */
199 "EM_SETRECTNP", /* 0x00b4 */
200 "EM_SCROLL", /* 0x00b5 */
201 "EM_LINESCROLL", /* 0x00b6 */
202 "EM_SCROLLCARET", /* 0x00b7 */
203 "EM_GETMODIFY", /* 0x00b8 */
204 "EM_SETMODIFY", /* 0x00b9 */
205 "EM_GETLINECOUNT", /* 0x00ba */
206 "EM_LINEINDEX", /* 0x00bb */
207 "EM_SETHANDLE", /* 0x00bc */
208 "EM_GETHANDLE", /* 0x00bd */
209 "EM_GETTHUMB", /* 0x00be */
210 NULL, /* 0x00bf */
212 NULL, /* 0x00c0 */
213 "EM_LINELENGTH", /* 0x00c1 */
214 "EM_REPLACESEL", /* 0x00c2 */
215 NULL, /* 0x00c3 */
216 "EM_GETLINE", /* 0x00c4 */
217 "EM_LIMITTEXT", /* 0x00c5 */
218 "EM_CANUNDO", /* 0x00c6 */
219 "EM_UNDO", /* 0x00c7 */
220 "EM_FMTLINES", /* 0x00c8 */
221 "EM_LINEFROMCHAR", /* 0x00c9 */
222 NULL, /* 0x00ca */
223 "EM_SETTABSTOPS", /* 0x00cb */
224 "EM_SETPASSWORDCHAR", /* 0x00cc */
225 "EM_EMPTYUNDOBUFFER", /* 0x00cd */
226 "EM_GETFIRSTVISIBLELINE", /* 0x00ce */
227 "EM_SETREADONLY", /* 0x00cf */
229 "EM_SETWORDBREAKPROC", /* 0x00d0 */
230 "EM_GETWORDBREAKPROC", /* 0x00d1 */
231 "EM_GETPASSWORDCHAR", /* 0x00d2 */
232 "EM_SETMARGINS", /* 0x00d3 */
233 "EM_GETMARGINS", /* 0x00d4 */
234 "EM_GETLIMITTEXT", /* 0x00d5 */
235 "EM_POSFROMCHAR", /* 0x00d6 */
236 "EM_CHARFROMPOS", /* 0x00d7 */
237 "EM_SETIMESTATUS", /* 0x00d8 */
238 "EM_GETIMESTATUS", /* 0x00d9 */
239 NULL, NULL, NULL, NULL, NULL, NULL,
241 /* 0x00E0 - Win32 Scrollbars */
242 "SBM_SETPOS", /* 0x00e0 */
243 "SBM_GETPOS", /* 0x00e1 */
244 "SBM_SETRANGE", /* 0x00e2 */
245 "SBM_GETRANGE", /* 0x00e3 */
246 "SBM_ENABLE_ARROWS", /* 0x00e4 */
247 NULL,
248 "SBM_SETRANGEREDRAW", /* 0x00e6 */
249 NULL, NULL,
250 "SBM_SETSCROLLINFO", /* 0x00e9 */
251 "SBM_GETSCROLLINFO", /* 0x00ea */
252 NULL, NULL, NULL, NULL, NULL,
254 /* 0x00F0 - Win32 Buttons */
255 "BM_GETCHECK", /* 0x00f0 */
256 "BM_SETCHECK", /* 0x00f1 */
257 "BM_GETSTATE", /* 0x00f2 */
258 "BM_SETSTATE", /* 0x00f3 */
259 "BM_SETSTYLE", /* 0x00f4 */
260 "BM_CLICK", /* 0x00f5 */
261 "BM_GETIMAGE", /* 0x00f6 */
262 "BM_SETIMAGE", /* 0x00f7 */
263 NULL, NULL, NULL, NULL, NULL, NULL,
264 "WM_INPUT_DEVICE_CHANGE", /* 0x00fe */
265 "WM_INPUT", /* 0x00ff */
267 "WM_KEYDOWN", /* 0x0100 */
268 "WM_KEYUP", /* 0x0101 */
269 "WM_CHAR", /* 0x0102 */
270 "WM_DEADCHAR", /* 0x0103 */
271 "WM_SYSKEYDOWN", /* 0x0104 */
272 "WM_SYSKEYUP", /* 0x0105 */
273 "WM_SYSCHAR", /* 0x0106 */
274 "WM_SYSDEADCHAR", /* 0x0107 */
275 NULL,
276 "WM_UNICHAR", /* 0x0109 */
277 "WM_CONVERTREQUEST", /* 0x010a */
278 "WM_CONVERTRESULT", /* 0x010b */
279 "WM_INTERIM", /* 0x010c */
280 "WM_IME_STARTCOMPOSITION", /* 0x010d */
281 "WM_IME_ENDCOMPOSITION", /* 0x010e */
282 "WM_IME_COMPOSITION", /* 0x010f */
284 "WM_INITDIALOG", /* 0x0110 */
285 "WM_COMMAND", /* 0x0111 */
286 "WM_SYSCOMMAND", /* 0x0112 */
287 "WM_TIMER", /* 0x0113 */
288 "WM_HSCROLL", /* 0x0114 */
289 "WM_VSCROLL", /* 0x0115 */
290 "WM_INITMENU", /* 0x0116 */
291 "WM_INITMENUPOPUP", /* 0x0117 */
292 "WM_SYSTIMER", /* 0x0118 */
293 NULL, NULL, NULL, NULL, NULL, NULL,
294 "WM_MENUSELECT", /* 0x011f */
296 "WM_MENUCHAR", /* 0x0120 */
297 "WM_ENTERIDLE", /* 0x0121 */
299 "WM_MENURBUTTONUP", /* 0x0122 */
300 "WM_MENUDRAG", /* 0x0123 */
301 "WM_MENUGETOBJECT", /* 0x0124 */
302 "WM_UNINITMENUPOPUP", /* 0x0125 */
303 "WM_MENUCOMMAND", /* 0x0126 */
304 "WM_CHANGEUISTATE", /* 0x0127 */
305 "WM_UPDATEUISTATE", /* 0x0128 */
306 "WM_QUERYUISTATE", /* 0x0129 */
308 NULL, NULL, NULL, NULL, NULL, NULL,
310 /* 0x0130 */
311 NULL,
312 "WM_LBTRACKPOINT", /* 0x0131 */
313 "WM_CTLCOLORMSGBOX", /* 0x0132 */
314 "WM_CTLCOLOREDIT", /* 0x0133 */
315 "WM_CTLCOLORLISTBOX", /* 0x0134 */
316 "WM_CTLCOLORBTN", /* 0x0135 */
317 "WM_CTLCOLORDLG", /* 0x0136 */
318 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
319 "WM_CTLCOLORSTATIC", /* 0x0138 */
320 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
322 /* 0x0140 - Win32 Comboboxes */
323 "CB_GETEDITSEL", /* 0x0140 */
324 "CB_LIMITTEXT", /* 0x0141 */
325 "CB_SETEDITSEL", /* 0x0142 */
326 "CB_ADDSTRING", /* 0x0143 */
327 "CB_DELETESTRING", /* 0x0144 */
328 "CB_DIR", /* 0x0145 */
329 "CB_GETCOUNT", /* 0x0146 */
330 "CB_GETCURSEL", /* 0x0147 */
331 "CB_GETLBTEXT", /* 0x0148 */
332 "CB_GETLBTEXTLEN", /* 0x0149 */
333 "CB_INSERTSTRING", /* 0x014a */
334 "CB_RESETCONTENT", /* 0x014b */
335 "CB_FINDSTRING", /* 0x014c */
336 "CB_SELECTSTRING", /* 0x014d */
337 "CB_SETCURSEL", /* 0x014e */
338 "CB_SHOWDROPDOWN", /* 0x014f */
340 "CB_GETITEMDATA", /* 0x0150 */
341 "CB_SETITEMDATA", /* 0x0151 */
342 "CB_GETDROPPEDCONTROLRECT", /* 0x0152 */
343 "CB_SETITEMHEIGHT", /* 0x0153 */
344 "CB_GETITEMHEIGHT", /* 0x0154 */
345 "CB_SETEXTENDEDUI", /* 0x0155 */
346 "CB_GETEXTENDEDUI", /* 0x0156 */
347 "CB_GETDROPPEDSTATE", /* 0x0157 */
348 "CB_FINDSTRINGEXACT", /* 0x0158 */
349 "CB_SETLOCALE", /* 0x0159 */
350 "CB_GETLOCALE", /* 0x015a */
351 "CB_GETTOPINDEX", /* 0x015b */
352 "CB_SETTOPINDEX", /* 0x015c */
353 "CB_GETHORIZONTALEXTENT", /* 0x015d */
354 "CB_SETHORIZONTALEXTENT", /* 0x015e */
355 "CB_GETDROPPEDWIDTH", /* 0x015f */
357 "CB_SETDROPPEDWIDTH", /* 0x0160 */
358 "CB_INITSTORAGE", /* 0x0161 */
359 NULL, NULL, NULL, NULL, NULL, NULL,
360 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
362 /* 0x0170 - Win32 Static controls */
363 "STM_SETICON", /* 0x0170 */
364 "STM_GETICON", /* 0x0171 */
365 "STM_SETIMAGE", /* 0x0172 */
366 "STM_GETIMAGE", /* 0x0173 */
367 NULL, NULL, NULL, NULL,
368 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
370 /* 0x0180 - Win32 Listboxes */
371 "LB_ADDSTRING", /* 0x0180 */
372 "LB_INSERTSTRING", /* 0x0181 */
373 "LB_DELETESTRING", /* 0x0182 */
374 "LB_SELITEMRANGEEX", /* 0x0183 */
375 "LB_RESETCONTENT", /* 0x0184 */
376 "LB_SETSEL", /* 0x0185 */
377 "LB_SETCURSEL", /* 0x0186 */
378 "LB_GETSEL", /* 0x0187 */
379 "LB_GETCURSEL", /* 0x0188 */
380 "LB_GETTEXT", /* 0x0189 */
381 "LB_GETTEXTLEN", /* 0x018a */
382 "LB_GETCOUNT", /* 0x018b */
383 "LB_SELECTSTRING", /* 0x018c */
384 "LB_DIR", /* 0x018d */
385 "LB_GETTOPINDEX", /* 0x018e */
386 "LB_FINDSTRING", /* 0x018f */
388 "LB_GETSELCOUNT", /* 0x0190 */
389 "LB_GETSELITEMS", /* 0x0191 */
390 "LB_SETTABSTOPS", /* 0x0192 */
391 "LB_GETHORIZONTALEXTENT", /* 0x0193 */
392 "LB_SETHORIZONTALEXTENT", /* 0x0194 */
393 "LB_SETCOLUMNWIDTH", /* 0x0195 */
394 "LB_ADDFILE", /* 0x0196 */
395 "LB_SETTOPINDEX", /* 0x0197 */
396 "LB_GETITEMRECT", /* 0x0198 */
397 "LB_GETITEMDATA", /* 0x0199 */
398 "LB_SETITEMDATA", /* 0x019a */
399 "LB_SELITEMRANGE", /* 0x019b */
400 "LB_SETANCHORINDEX", /* 0x019c */
401 "LB_GETANCHORINDEX", /* 0x019d */
402 "LB_SETCARETINDEX", /* 0x019e */
403 "LB_GETCARETINDEX", /* 0x019f */
405 "LB_SETITEMHEIGHT", /* 0x01a0 */
406 "LB_GETITEMHEIGHT", /* 0x01a1 */
407 "LB_FINDSTRINGEXACT", /* 0x01a2 */
408 "LB_CARETON", /* 0x01a3 */
409 "LB_CARETOFF", /* 0x01a4 */
410 "LB_SETLOCALE", /* 0x01a5 */
411 "LB_GETLOCALE", /* 0x01a6 */
412 "LB_SETCOUNT", /* 0x01a7 */
413 "LB_INITSTORAGE", /* 0x01a8 */
414 "LB_ITEMFROMPOINT", /* 0x01a9 */
415 NULL, NULL, NULL, NULL, NULL, NULL,
417 /* 0x01B0 */
418 NULL, NULL,
419 "LB_GETLISTBOXINFO", /* 0x01b2 */
420 NULL, NULL, NULL, NULL, NULL,
421 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
423 /* 0x01C0 */
424 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
425 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
427 /* 0x01D0 */
428 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
429 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
431 /* 0x01E0 */
432 NULL,
433 "MN_GETHMENU", /* 0x01E1 */
434 NULL, NULL, NULL, NULL, NULL, NULL,
435 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
437 /* 0x01F0 */
438 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
439 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
441 "WM_MOUSEMOVE", /* 0x0200 */
442 "WM_LBUTTONDOWN", /* 0x0201 */
443 "WM_LBUTTONUP", /* 0x0202 */
444 "WM_LBUTTONDBLCLK", /* 0x0203 */
445 "WM_RBUTTONDOWN", /* 0x0204 */
446 "WM_RBUTTONUP", /* 0x0205 */
447 "WM_RBUTTONDBLCLK", /* 0x0206 */
448 "WM_MBUTTONDOWN", /* 0x0207 */
449 "WM_MBUTTONUP", /* 0x0208 */
450 "WM_MBUTTONDBLCLK", /* 0x0209 */
451 "WM_MOUSEWHEEL", /* 0x020A */
452 "WM_XBUTTONDOWN", /* 0x020B */
453 "WM_XBUTTONUP", /* 0x020C */
454 "WM_XBUTTONDBLCLK", /* 0x020D */
455 "WM_MOUSEHWHEEL", /* 0x020E */
456 NULL,
458 "WM_PARENTNOTIFY", /* 0x0210 */
459 "WM_ENTERMENULOOP", /* 0x0211 */
460 "WM_EXITMENULOOP", /* 0x0212 */
461 "WM_NEXTMENU", /* 0x0213 */
462 "WM_SIZING",
463 "WM_CAPTURECHANGED",
464 "WM_MOVING", NULL,
465 "WM_POWERBROADCAST",
466 "WM_DEVICECHANGE", NULL, NULL, NULL, NULL, NULL, NULL,
468 "WM_MDICREATE", /* 0x0220 */
469 "WM_MDIDESTROY", /* 0x0221 */
470 "WM_MDIACTIVATE", /* 0x0222 */
471 "WM_MDIRESTORE", /* 0x0223 */
472 "WM_MDINEXT", /* 0x0224 */
473 "WM_MDIMAXIMIZE", /* 0x0225 */
474 "WM_MDITILE", /* 0x0226 */
475 "WM_MDICASCADE", /* 0x0227 */
476 "WM_MDIICONARRANGE", /* 0x0228 */
477 "WM_MDIGETACTIVE", /* 0x0229 */
479 "WM_DROPOBJECT",
480 "WM_QUERYDROPOBJECT",
481 "WM_BEGINDRAG",
482 "WM_DRAGLOOP",
483 "WM_DRAGSELECT",
484 "WM_DRAGMOVE",
486 /* 0x0230*/
487 "WM_MDISETMENU", /* 0x0230 */
488 "WM_ENTERSIZEMOVE", /* 0x0231 */
489 "WM_EXITSIZEMOVE", /* 0x0232 */
490 "WM_DROPFILES", /* 0x0233 */
491 "WM_MDIREFRESHMENU", /* 0x0234 */
492 NULL, NULL, NULL,
493 "WM_POINTERDEVICECHANGE", /* 0x0238 */
494 "WM_POINTERDEVICEINRANGE", /* 0x0239 */
495 "WM_POINTERDEVICEOUTOFRANGE", /* 0x023a */
496 NULL, NULL, NULL, NULL, NULL,
498 /* 0x0240 */
499 "WM_TOUCH", /* 0x0240 */
500 "WM_NCPOINTERUPDATE", /* 0x0241 */
501 "WM_NCPOINTERDOWN", /* 0x0242 */
502 "WM_NCPOINTERUP", /* 0x0243 */
503 NULL,
504 "WM_POINTERUPDATE", /* 0x0245 */
505 "WM_POINTERDOWN", /* 0x0246 */
506 "WM_POINTERUP", /* 0x0247 */
507 NULL,
508 "WM_POINTERENTER", /* 0x0249 */
509 "WM_POINTERLEAVE", /* 0x024a */
510 "WM_POINTERACTIVATE", /* 0x024b */
511 "WM_POINTERCAPTURECHANGED", /* 0x024c */
512 "WM_TOUCHHITTESTING", /* 0x024d */
513 "WM_POINTERWHEEL", /* 0x024e */
514 "WM_POINTERHWHEEL", /* 0x024f */
516 /* 0x0250 */
517 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
518 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
520 /* 0x0260 */
521 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
522 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
523 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
524 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
526 /* 0x0280 */
527 NULL,
528 "WM_IME_SETCONTEXT", /* 0x0281 */
529 "WM_IME_NOTIFY", /* 0x0282 */
530 "WM_IME_CONTROL", /* 0x0283 */
531 "WM_IME_COMPOSITIONFULL", /* 0x0284 */
532 "WM_IME_SELECT", /* 0x0285 */
533 "WM_IME_CHAR", /* 0x0286 */
534 NULL,
535 "WM_IME_REQUEST", /* 0x0288 */
536 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
537 "WM_IME_KEYDOWN", /* 0x0290 */
538 "WM_IME_KEYUP", /* 0x0291 */
539 NULL, NULL, NULL, NULL, NULL, NULL,
540 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
542 /* 0x02a0 */
543 "WM_NCMOUSEHOVER", /* 0x02A0 */
544 "WM_MOUSEHOVER", /* 0x02A1 */
545 "WM_NCMOUSELEAVE", /* 0x02A2 */
546 "WM_MOUSELEAVE", /* 0x02A3 */
547 NULL, NULL, NULL, NULL, NULL, NULL,
548 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
549 "WM_WTSSESSION_CHANGE", /* 0x02B1 */
550 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
551 NULL, NULL, NULL, NULL, NULL, NULL,
553 /* 0x02c0 */
554 "WM_TABLET_FIRST", /* 0x02c0 */
555 "WM_TABLET_FIRST+1", /* 0x02c1 */
556 "WM_TABLET_FIRST+2", /* 0x02c2 */
557 "WM_TABLET_FIRST+3", /* 0x02c3 */
558 "WM_TABLET_FIRST+4", /* 0x02c4 */
559 "WM_TABLET_FIRST+5", /* 0x02c5 */
560 "WM_TABLET_FIRST+7", /* 0x02c6 */
561 "WM_TABLET_FIRST+8", /* 0x02c7 */
562 "WM_TABLET_FIRST+9", /* 0x02c8 */
563 "WM_TABLET_FIRST+10", /* 0x02c9 */
564 "WM_TABLET_FIRST+11", /* 0x02ca */
565 "WM_TABLET_FIRST+12", /* 0x02cb */
566 "WM_TABLET_FIRST+13", /* 0x02cc */
567 "WM_TABLET_FIRST+14", /* 0x02cd */
568 "WM_TABLET_FIRST+15", /* 0x02ce */
569 "WM_TABLET_FIRST+16", /* 0x02cf */
570 "WM_TABLET_FIRST+17", /* 0x02d0 */
571 "WM_TABLET_FIRST+18", /* 0x02d1 */
572 "WM_TABLET_FIRST+19", /* 0x02d2 */
573 "WM_TABLET_FIRST+20", /* 0x02d3 */
574 "WM_TABLET_FIRST+21", /* 0x02d4 */
575 "WM_TABLET_FIRST+22", /* 0x02d5 */
576 "WM_TABLET_FIRST+23", /* 0x02d6 */
577 "WM_TABLET_FIRST+24", /* 0x02d7 */
578 "WM_TABLET_FIRST+25", /* 0x02d8 */
579 "WM_TABLET_FIRST+26", /* 0x02d9 */
580 "WM_TABLET_FIRST+27", /* 0x02da */
581 "WM_TABLET_FIRST+28", /* 0x02db */
582 "WM_TABLET_FIRST+29", /* 0x02dc */
583 "WM_TABLET_FIRST+30", /* 0x02dd */
584 "WM_TABLET_FIRST+31", /* 0x02de */
585 "WM_TABLET_LAST", /* 0x02df */
587 "WM_DPICHANGED", /* 0x02e0 */
588 NULL,
589 "WM_DPICHANGED_BEFOREPARENT",/* 0x02e2 */
590 "WM_DPICHANGED_AFTERPARENT",/* 0x02e3 */
591 "WM_GETDPISCALEDSIZE", /* 0x02e4 */
592 NULL, NULL, NULL,
594 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
595 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
596 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
598 "WM_CUT", /* 0x0300 */
599 "WM_COPY",
600 "WM_PASTE",
601 "WM_CLEAR",
602 "WM_UNDO",
603 "WM_RENDERFORMAT",
604 "WM_RENDERALLFORMATS",
605 "WM_DESTROYCLIPBOARD",
606 "WM_DRAWCLIPBOARD",
607 "WM_PAINTCLIPBOARD",
608 "WM_VSCROLLCLIPBOARD",
609 "WM_SIZECLIPBOARD",
610 "WM_ASKCBFORMATNAME",
611 "WM_CHANGECBCHAIN",
612 "WM_HSCROLLCLIPBOARD",
613 "WM_QUERYNEWPALETTE", /* 0x030f*/
615 "WM_PALETTEISCHANGING",
616 "WM_PALETTECHANGED",
617 "WM_HOTKEY", /* 0x0312 */
618 "WM_POPUPSYSTEMMENU", /* 0x0313 */
619 NULL, NULL, NULL,
620 "WM_PRINT", /* 0x0317 */
621 "WM_PRINTCLIENT", /* 0x0318 */
622 "WM_APPCOMMAND", /* 0x0319 */
623 "WM_THEMECHANGED", /* 0x031A */
624 NULL, NULL,
625 "WM_CLIPBOARDUPDATE", /* 0x031D */
626 "WM_DWMCOMPOSITIONCHANGED", /* 0x031E */
627 "WM_DWMNCRENDERINGCHANGED", /* 0x031F */
629 "WM_DWMCOLORIZATIONCOLORCHANGED", /* 0x0320 */
630 "WM_DWMWINDOWMAXIMIZEDCHANGE", /* 0x0321 */
631 NULL, NULL, NULL, NULL, NULL, NULL,
632 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
634 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
635 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
636 "WM_GETTITLEBARINFOEX", /* 0x033F */
638 /* 0x0340 */
639 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
640 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
641 /* 0x0350 */
642 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
643 "WM_HANDHELDFIRST", /* 0x0358 */
644 "WM_HANDHELDFIRST+1", /* 0x0359 */
645 "WM_HANDHELDFIRST+2", /* 0x035A */
646 "WM_HANDHELDFIRST+3", /* 0x035B */
647 "WM_HANDHELDFIRST+4", /* 0x035C */
648 "WM_HANDHELDFIRST+5", /* 0x035D */
649 "WM_HANDHELDFIRST+6", /* 0x035E */
650 "WM_HANDHELDLAST", /* 0x035F */
652 "WM_QUERYAFXWNDPROC", /* 0x0360 WM_AFXFIRST */
653 "WM_SIZEPARENT", /* 0x0361 */
654 "WM_SETMESSAGESTRING", /* 0x0362 */
655 "WM_IDLEUPDATECMDUI", /* 0x0363 */
656 "WM_INITIALUPDATE", /* 0x0364 */
657 "WM_COMMANDHELP", /* 0x0365 */
658 "WM_HELPHITTEST", /* 0x0366 */
659 "WM_EXITHELPMODE", /* 0x0367 */
660 "WM_RECALCPARENT", /* 0x0368 */
661 "WM_SIZECHILD", /* 0x0369 */
662 "WM_KICKIDLE", /* 0x036A */
663 "WM_QUERYCENTERWND", /* 0x036B */
664 "WM_DISABLEMODAL", /* 0x036C */
665 "WM_FLOATSTATUS", /* 0x036D */
666 "WM_ACTIVATETOPLEVEL", /* 0x036E */
667 "WM_QUERY3DCONTROLS", /* 0x036F */
668 NULL,NULL,NULL,
669 "WM_SOCKET_NOTIFY", /* 0x0373 */
670 "WM_SOCKET_DEAD", /* 0x0374 */
671 "WM_POPMESSAGESTRING", /* 0x0375 */
672 "WM_OCC_LOADFROMSTREAM", /* 0x0376 */
673 "WM_OCC_LOADFROMSTORAGE", /* 0x0377 */
674 "WM_OCC_INITNEW", /* 0x0378 */
675 "WM_QUEUE_SENTINEL", /* 0x0379 */
676 "WM_OCC_LOADFROMSTREAM_EX", /* 0x037A */
677 "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */
679 NULL,NULL,NULL,
680 "WM_AFXLAST", /* 0x037F */
682 "WM_PENWINFIRST", /* 0x0380 */
683 "WM_RCRESULT", /* 0x0381 */
684 "WM_HOOKRCRESULT", /* 0x0382 */
685 "WM_GLOBALRCCHANGE", /* 0x0383 */
686 "WM_SKB", /* 0x0384 */
687 "WM_HEDITCTL", /* 0x0385 */
688 NULL, NULL,
689 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
690 "WM_PENWINLAST", /* 0x038F */
692 "WM_COALESCE_FIRST", /* 0x0390 */
693 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
694 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
695 "WM_COALESCE_LAST", /* 0x039F */
697 /* 0x03a0 */
698 "MM_JOY1MOVE",
699 "MM_JOY2MOVE",
700 "MM_JOY1ZMOVE",
701 "MM_JOY2ZMOVE",
702 NULL, NULL, NULL, NULL,
703 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
705 /* 0x03b0 */
706 NULL, NULL, NULL, NULL, NULL,
707 "MM_JOY1BUTTONDOWN",
708 "MM_JOY2BUTTONDOWN",
709 "MM_JOY1BUTTONUP",
710 "MM_JOY2BUTTONUP",
711 "MM_MCINOTIFY", /* 0x03B9 */
712 NULL,
713 "MM_WOM_OPEN", /* 0x03BB */
714 "MM_WOM_CLOSE", /* 0x03BC */
715 "MM_WOM_DONE", /* 0x03BD */
716 "MM_WIM_OPEN", /* 0x03BE */
717 "MM_WIM_CLOSE", /* 0x03BF */
719 /* 0x03c0 */
720 "MM_WIM_DATA", /* 0x03C0 */
721 "MM_MIM_OPEN", /* 0x03C1 */
722 "MM_MIM_CLOSE", /* 0x03C2 */
723 "MM_MIM_DATA", /* 0x03C3 */
724 "MM_MIM_LONGDATA", /* 0x03C4 */
725 "MM_MIM_ERROR", /* 0x03C5 */
726 "MM_MIM_LONGERROR", /* 0x03C6 */
727 "MM_MOM_OPEN", /* 0x03C7 */
728 "MM_MOM_CLOSE", /* 0x03C8 */
729 "MM_MOM_DONE", /* 0x03C9 */
730 "MM_MOM_POSITIONCB", /* 0x03CA */
731 "MM_MCISIGNAL", /* 0x03CB */
732 "MM_MIM_MOREDATA", /* 0x03CC */
733 NULL, NULL, NULL,
735 /* 0x03d0 */
736 "MM_MIXM_LINE_CHANGE",
737 "MM_MIXM_CONTROL_CHANGE",
738 NULL, NULL, NULL, NULL, NULL, NULL,
739 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
741 /* 0x03e0 */
742 "WM_DDE_INITIATE", /* 0x3E0 */
743 "WM_DDE_TERMINATE", /* 0x3E1 */
744 "WM_DDE_ADVISE", /* 0x3E2 */
745 "WM_DDE_UNADVISE", /* 0x3E3 */
746 "WM_DDE_ACK", /* 0x3E4 */
747 "WM_DDE_DATA", /* 0x3E5 */
748 "WM_DDE_REQUEST", /* 0x3E6 */
749 "WM_DDE_POKE", /* 0x3E7 */
750 "WM_DDE_EXECUTE", /* 0x3E8 */
751 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
754 /* 0x03f0 */
755 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
756 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
758 "WM_USER" /* 0x0400 */
762 #define SPY_MAX_LVMMSGNUM 182
763 static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] =
765 "LVM_GETBKCOLOR", /* 1000 */
766 "LVM_SETBKCOLOR",
767 "LVM_GETIMAGELIST",
768 "LVM_SETIMAGELIST",
769 "LVM_GETITEMCOUNT",
770 "LVM_GETITEMA",
771 "LVM_SETITEMA",
772 "LVM_INSERTITEMA",
773 "LVM_DELETEITEM",
774 "LVM_DELETEALLITEMS",
775 "LVM_GETCALLBACKMASK",
776 "LVM_SETCALLBACKMASK",
777 "LVM_GETNEXTITEM",
778 "LVM_FINDITEMA",
779 "LVM_GETITEMRECT",
780 "LVM_SETITEMPOSITION",
781 "LVM_GETITEMPOSITION",
782 "LVM_GETSTRINGWIDTHA",
783 "LVM_HITTEST",
784 "LVM_ENSUREVISIBLE",
785 "LVM_SCROLL",
786 "LVM_REDRAWITEMS",
787 "LVM_ARRANGE",
788 "LVM_EDITLABELA",
789 "LVM_GETEDITCONTROL",
790 "LVM_GETCOLUMNA",
791 "LVM_SETCOLUMNA",
792 "LVM_INSERTCOLUMNA",
793 "LVM_DELETECOLUMN",
794 "LVM_GETCOLUMNWIDTH",
795 "LVM_SETCOLUMNWIDTH",
796 "LVM_GETHEADER",
797 NULL,
798 "LVM_CREATEDRAGIMAGE",
799 "LVM_GETVIEWRECT",
800 "LVM_GETTEXTCOLOR",
801 "LVM_SETTEXTCOLOR",
802 "LVM_GETTEXTBKCOLOR",
803 "LVM_SETTEXTBKCOLOR",
804 "LVM_GETTOPINDEX",
805 "LVM_GETCOUNTPERPAGE",
806 "LVM_GETORIGIN",
807 "LVM_UPDATE",
808 "LVM_SETITEMSTATE",
809 "LVM_GETITEMSTATE",
810 "LVM_GETITEMTEXTA",
811 "LVM_SETITEMTEXTA",
812 "LVM_SETITEMCOUNT",
813 "LVM_SORTITEMS",
814 "LVM_SETITEMPOSITION32",
815 "LVM_GETSELECTEDCOUNT",
816 "LVM_GETITEMSPACING",
817 "LVM_GETISEARCHSTRINGA",
818 "LVM_SETICONSPACING",
819 "LVM_SETEXTENDEDLISTVIEWSTYLE",
820 "LVM_GETEXTENDEDLISTVIEWSTYLE",
821 "LVM_GETSUBITEMRECT",
822 "LVM_SUBITEMHITTEST",
823 "LVM_SETCOLUMNORDERARRAY",
824 "LVM_GETCOLUMNORDERARRAY",
825 "LVM_SETHOTITEM",
826 "LVM_GETHOTITEM",
827 "LVM_SETHOTCURSOR",
828 "LVM_GETHOTCURSOR",
829 "LVM_APPROXIMATEVIEWRECT",
830 "LVM_SETWORKAREAS",
831 "LVM_GETSELECTIONMARK",
832 "LVM_SETSELECTIONMARK",
833 "LVM_SETBKIMAGEA",
834 "LVM_GETBKIMAGEA",
835 "LVM_GETWORKAREAS",
836 "LVM_SETHOVERTIME",
837 "LVM_GETHOVERTIME",
838 "LVM_GETNUMBEROFWORKAREAS",
839 "LVM_SETTOOLTIPS",
840 "LVM_GETITEMW",
841 "LVM_SETITEMW",
842 "LVM_INSERTITEMW",
843 "LVM_GETTOOLTIPS",
844 NULL,
845 NULL,
846 NULL,
847 NULL,
848 "LVM_FINDITEMW",
849 NULL,
850 NULL,
851 NULL,
852 "LVM_GETSTRINGWIDTHW",
853 NULL,
854 NULL,
855 NULL,
856 NULL,
857 NULL,
858 NULL,
859 NULL,
860 "LVM_GETCOLUMNW",
861 "LVM_SETCOLUMNW",
862 "LVM_INSERTCOLUMNW",
863 NULL,
864 NULL,
865 NULL,
866 NULL,
867 NULL,
868 NULL,
869 NULL,
870 NULL,
871 NULL,
872 NULL,
873 NULL,
874 NULL,
875 NULL,
876 NULL,
877 NULL,
878 NULL,
879 NULL,
880 "LVM_GETITEMTEXTW",
881 "LVM_SETITEMTEXTW",
882 "LVM_GETISEARCHSTRINGW",
883 "LVM_EDITLABELW",
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 NULL,
897 NULL,
898 NULL,
899 NULL,
900 NULL,
901 NULL,
902 NULL,
903 "LVM_SETBKIMAGEW",
904 "LVM_GETBKIMAGEW", /* 0x108B */
905 "LVM_SETSELECTEDCOLUMN",
906 "LVM_SETTILEWIDTH",
907 "LVM_SETVIEW",
908 "LVM_GETVIEW",
909 NULL,
910 "LVM_INSERTGROUP",
911 NULL,
912 "LVM_SETGROUPINFO",
913 NULL,
914 "LVM_GETGROUPINFO",
915 "LVM_REMOVEGROUP",
916 "LVM_MOVEGROUP",
917 NULL,
918 NULL,
919 "LVM_MOVEITEMTOGROUP",
920 "LVM_SETGROUPMETRICS",
921 "LVM_GETGROUPMETRICS",
922 "LVM_ENABLEGROUPVIEW",
923 "LVM_SORTGROUPS",
924 "LVM_INSERTGROUPSORTED",
925 "LVM_REMOVEALLGROUPS",
926 "LVM_HASGROUP",
927 "LVM_SETTILEVIEWINFO",
928 "LVM_GETTILEVIEWINFO",
929 "LVM_SETTILEINFO",
930 "LVM_GETTILEINFO",
931 "LVM_SETINSERTMARK",
932 "LVM_GETINSERTMARK",
933 "LVM_INSERTMARKHITTEST",
934 "LVM_GETINSERTMARKRECT",
935 "LVM_SETINSERTMARKCOLOR",
936 "LVM_GETINSERTMARKCOLOR",
937 NULL,
938 "LVM_SETINFOTIP",
939 "LVM_GETSELECTEDCOLUMN",
940 "LVM_ISGROUPVIEWENABLED",
941 "LVM_GETOUTLINECOLOR",
942 "LVM_SETOUTLINECOLOR",
943 NULL,
944 "LVM_CANCELEDITLABEL",
945 "LVM_MAPINDEXTOID",
946 "LVM_MAPIDTOINDEX",
947 "LVM_ISITEMVISIBLE"
951 #define SPY_MAX_TVMSGNUM 65
952 static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] =
954 "TVM_INSERTITEMA", /* 1100 */
955 "TVM_DELETEITEM",
956 "TVM_EXPAND",
957 NULL,
958 "TVM_GETITEMRECT",
959 "TVM_GETCOUNT",
960 "TVM_GETINDENT",
961 "TVM_SETINDENT",
962 "TVM_GETIMAGELIST",
963 "TVM_SETIMAGELIST",
964 "TVM_GETNEXTITEM",
965 "TVM_SELECTITEM",
966 "TVM_GETITEMA",
967 "TVM_SETITEMA",
968 "TVM_EDITLABELA",
969 "TVM_GETEDITCONTROL",
970 "TVM_GETVISIBLECOUNT",
971 "TVM_HITTEST",
972 "TVM_CREATEDRAGIMAGE",
973 "TVM_SORTCHILDREN",
974 "TVM_ENSUREVISIBLE",
975 "TVM_SORTCHILDRENCB",
976 "TVM_ENDEDITLABELNOW",
977 "TVM_GETISEARCHSTRINGA",
978 "TVM_SETTOOLTIPS",
979 "TVM_GETTOOLTIPS",
980 "TVM_SETINSERTMARK",
981 "TVM_SETITEMHEIGHT",
982 "TVM_GETITEMHEIGHT",
983 "TVM_SETBKCOLOR",
984 "TVM_SETTEXTCOLOR",
985 "TVM_GETBKCOLOR",
986 "TVM_GETTEXTCOLOR",
987 "TVM_SETSCROLLTIME",
988 "TVM_GETSCROLLTIME",
989 "TVM_UNKNOWN35",
990 "TVM_UNKNOWN36",
991 "TVM_SETINSERTMARKCOLOR",
992 "TVM_GETINSERTMARKCOLOR",
993 "TVM_GETITEMSTATE",
994 "TVM_SETLINECOLOR",
995 "TVM_GETLINECOLOR",
996 NULL,
997 NULL,
998 NULL,
999 NULL,
1000 NULL,
1001 NULL,
1002 NULL,
1003 NULL,
1004 "TVM_INSERTITEMW",
1005 NULL,
1006 NULL,
1007 NULL,
1008 NULL,
1009 NULL,
1010 NULL,
1011 NULL,
1012 NULL,
1013 NULL,
1014 NULL,
1015 NULL,
1016 "TVM_GETITEMW",
1017 "TVM_SETITEMW",
1018 "TVM_GETISEARCHSTRINGW",
1019 "TVM_EDITLABELW"
1023 #define SPY_MAX_HDMMSGNUM 19
1024 static const char * const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM + 1] =
1026 "HDM_GETITEMCOUNT", /* 1200 */
1027 "HDM_INSERTITEMA",
1028 "HDM_DELETEITEM",
1029 "HDM_GETITEMA",
1030 "HDM_SETITEMA",
1031 "HDM_LAYOUT",
1032 "HDM_HITTEST",
1033 "HDM_GETITEMRECT",
1034 "HDM_SETIMAGELIST",
1035 "HDM_GETIMAGELIST",
1036 "HDM_INSERTITEMW",
1037 "HDM_GETITEMW",
1038 "HDM_SETITEMW",
1039 NULL,
1040 NULL,
1041 "HDM_ORDERTOINDEX",
1042 "HDM_CREATEDRAGIMAGE",
1043 "GETORDERARRAYINDEX",
1044 "SETORDERARRAYINDEX",
1045 "SETHOTDIVIDER"
1049 #define SPY_MAX_TCMMSGNUM 62
1050 static const char * const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM + 1] =
1052 NULL, /* 1300 */
1053 NULL,
1054 "TCM_SETIMAGELIST",
1055 "TCM_GETIMAGELIST",
1056 "TCM_GETITEMCOUNT",
1057 "TCM_GETITEMA",
1058 "TCM_SETITEMA",
1059 "TCM_INSERTITEMA",
1060 "TCM_DELETEITEM",
1061 "TCM_DELETEALLITEMS",
1062 "TCM_GETITEMRECT",
1063 "TCM_GETCURSEL",
1064 "TCM_SETCURSEL",
1065 "TCM_HITTEST",
1066 "TCM_SETITEMEXTRA",
1067 NULL,
1068 NULL,
1069 NULL,
1070 NULL,
1071 NULL,
1072 NULL,
1073 NULL,
1074 NULL,
1075 NULL,
1076 NULL,
1077 NULL,
1078 NULL,
1079 NULL,
1080 NULL,
1081 NULL,
1082 NULL,
1083 NULL,
1084 NULL,
1085 NULL,
1086 NULL,
1087 NULL,
1088 NULL,
1089 NULL,
1090 NULL,
1091 NULL,
1092 "TCM_ADJUSTRECT",
1093 "TCM_SETITEMSIZE",
1094 "TCM_REMOVEIMAGE",
1095 "TCM_SETPADDING",
1096 "TCM_GETROWCOUNT",
1097 "TCM_GETTOOLTIPS",
1098 "TCM_SETTOOLTIPS",
1099 "TCM_GETCURFOCUS",
1100 "TCM_SETCURFOCUS",
1101 "TCM_SETMINTABWIDTH",
1102 "TCM_DESELECTALL",
1103 "TCM_HIGHLIGHTITEM",
1104 "TCM_SETEXTENDEDSTYLE",
1105 "TCM_GETEXTENDEDSTYLE",
1106 NULL,
1107 NULL,
1108 NULL,
1109 NULL,
1110 NULL,
1111 NULL,
1112 "TCM_GETITEMW",
1113 "TCM_SETITEMW",
1114 "TCM_INSERTITEMW"
1117 #define SPY_MAX_PGMMSGNUM 13
1118 static const char * const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM + 1] =
1120 NULL, /* 1400 */
1121 "PGM_SETCHILD",
1122 "PGM_RECALCSIZE",
1123 "PGM_FORWARDMOUSE",
1124 "PGM_SETBKCOLOR",
1125 "PGM_GETBKCOLOR",
1126 "PGM_SETBORDER",
1127 "PGM_GETBORDER",
1128 "PGM_SETPOS",
1129 "PGM_GETPOS",
1130 "PGM_SETBUTTONSIZE",
1131 "PGM_GETBUTTONSIZE",
1132 "PGM_GETBUTTONSTATE",
1133 "PGM_GETDROPTARGET"
1137 #define SPY_MAX_CCMMSGNUM 9
1138 static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] =
1140 NULL, /* 0x2000 */
1141 "CCM_SETBKCOLOR",
1142 "CCM_SETCOLORSCHEME",
1143 "CCM_GETCOLORSCHEME",
1144 "CCM_GETDROPTARGET",
1145 "CCM_SETUNICODEFORMAT",
1146 "CCM_GETUNICODEFORMAT",
1147 "CCM_SETVERSION",
1148 "CCM_GETVERSION",
1149 "CCM_SETNOTIFYWINDOW"
1152 #define SPY_MAX_WINEMSGNUM (WM_WINE_UPDATEWINDOWSTATE - WM_WINE_DESTROYWINDOW)
1153 static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] =
1155 "WM_WINE_DESTROYWINDOW",
1156 "WM_WINE_SETWINDOWPOS",
1157 "WM_WINE_SHOWWINDOW",
1158 "WM_WINE_SETPARENT",
1159 "WM_WINE_SETWINDOWLONG",
1160 "WM_WINE_SETSTYLE",
1161 "WM_WINE_SETACTIVEWINDOW",
1162 "WM_WINE_KEYBOARD_LL_HOOK",
1163 "WM_WINE_MOUSE_LL_HOOK",
1164 "WM_WINE_CLIPCURSOR",
1165 "WM_WINE_UPDATEWINDOWSTATE",
1168 /* Virtual key names */
1169 #define SPY_MAX_VKKEYSNUM 255
1170 static const char * const VK_KeyNames[SPY_MAX_VKKEYSNUM + 1] =
1172 NULL, /* 0x00 */
1173 "VK_LBUTTON", /* 0x01 */
1174 "VK_RBUTTON", /* 0x02 */
1175 "VK_CANCEL", /* 0x03 */
1176 "VK_MBUTTON", /* 0x04 */
1177 "VK_XBUTTON1", /* 0x05 */
1178 "VK_XBUTTON2", /* 0x06 */
1179 NULL, /* 0x07 */
1180 "VK_BACK", /* 0x08 */
1181 "VK_TAB", /* 0x09 */
1182 NULL, /* 0x0A */
1183 NULL, /* 0x0B */
1184 "VK_CLEAR", /* 0x0C */
1185 "VK_RETURN", /* 0x0D */
1186 NULL, /* 0x0E */
1187 NULL, /* 0x0F */
1188 "VK_SHIFT", /* 0x10 */
1189 "VK_CONTROL", /* 0x11 */
1190 "VK_MENU", /* 0x12 */
1191 "VK_PAUSE", /* 0x13 */
1192 "VK_CAPITAL", /* 0x14 */
1193 NULL, /* 0x15 */
1194 NULL, /* 0x16 */
1195 NULL, /* 0x17 */
1196 NULL, /* 0x18 */
1197 NULL, /* 0x19 */
1198 NULL, /* 0x1A */
1199 "VK_ESCAPE", /* 0x1B */
1200 "VK_CONVERT", /* 0x1C */
1201 "VK_NONCONVERT", /* 0x1D */
1202 "VK_ACCEPT", /* 0x1E */
1203 "VK_MODECHANGE", /* 0x1F */
1204 "VK_SPACE", /* 0x20 */
1205 "VK_PRIOR", /* 0x21 */
1206 "VK_NEXT", /* 0x22 */
1207 "VK_END", /* 0x23 */
1208 "VK_HOME", /* 0x24 */
1209 "VK_LEFT", /* 0x25 */
1210 "VK_UP", /* 0x26 */
1211 "VK_RIGHT", /* 0x27 */
1212 "VK_DOWN", /* 0x28 */
1213 "VK_SELECT", /* 0x29 */
1214 "VK_PRINT", /* 0x2A */
1215 "VK_EXECUTE", /* 0x2B */
1216 "VK_SNAPSHOT", /* 0x2C */
1217 "VK_INSERT", /* 0x2D */
1218 "VK_DELETE", /* 0x2E */
1219 "VK_HELP", /* 0x2F */
1220 "VK_0", /* 0x30 */
1221 "VK_1", /* 0x31 */
1222 "VK_2", /* 0x32 */
1223 "VK_3", /* 0x33 */
1224 "VK_4", /* 0x34 */
1225 "VK_5", /* 0x35 */
1226 "VK_6", /* 0x36 */
1227 "VK_7", /* 0x37 */
1228 "VK_8", /* 0x38 */
1229 "VK_9", /* 0x39 */
1230 NULL, /* 0x3A */
1231 NULL, /* 0x3B */
1232 NULL, /* 0x3C */
1233 NULL, /* 0x3D */
1234 NULL, /* 0x3E */
1235 NULL, /* 0x3F */
1236 NULL, /* 0x40 */
1237 "VK_A", /* 0x41 */
1238 "VK_B", /* 0x42 */
1239 "VK_C", /* 0x43 */
1240 "VK_D", /* 0x44 */
1241 "VK_E", /* 0x45 */
1242 "VK_F", /* 0x46 */
1243 "VK_G", /* 0x47 */
1244 "VK_H", /* 0x48 */
1245 "VK_I", /* 0x49 */
1246 "VK_J", /* 0x4A */
1247 "VK_K", /* 0x4B */
1248 "VK_L", /* 0x4C */
1249 "VK_M", /* 0x4D */
1250 "VK_N", /* 0x4E */
1251 "VK_O", /* 0x4F */
1252 "VK_P", /* 0x50 */
1253 "VK_Q", /* 0x51 */
1254 "VK_R", /* 0x52 */
1255 "VK_S", /* 0x53 */
1256 "VK_T", /* 0x54 */
1257 "VK_U", /* 0x55 */
1258 "VK_V", /* 0x56 */
1259 "VK_W", /* 0x57 */
1260 "VK_X", /* 0x58 */
1261 "VK_Y", /* 0x59 */
1262 "VK_Z", /* 0x5A */
1263 "VK_LWIN", /* 0x5B */
1264 "VK_RWIN", /* 0x5C */
1265 "VK_APPS", /* 0x5D */
1266 NULL, /* 0x5E */
1267 "VK_SLEEP", /* 0x5F */
1268 "VK_NUMPAD0", /* 0x60 */
1269 "VK_NUMPAD1", /* 0x61 */
1270 "VK_NUMPAD2", /* 0x62 */
1271 "VK_NUMPAD3", /* 0x63 */
1272 "VK_NUMPAD4", /* 0x64 */
1273 "VK_NUMPAD5", /* 0x65 */
1274 "VK_NUMPAD6", /* 0x66 */
1275 "VK_NUMPAD7", /* 0x67 */
1276 "VK_NUMPAD8", /* 0x68 */
1277 "VK_NUMPAD9", /* 0x69 */
1278 "VK_MULTIPLY", /* 0x6A */
1279 "VK_ADD", /* 0x6B */
1280 "VK_SEPARATOR", /* 0x6C */
1281 "VK_SUBTRACT", /* 0x6D */
1282 "VK_DECIMAL", /* 0x6E */
1283 "VK_DIVIDE", /* 0x6F */
1284 "VK_F1", /* 0x70 */
1285 "VK_F2", /* 0x71 */
1286 "VK_F3", /* 0x72 */
1287 "VK_F4", /* 0x73 */
1288 "VK_F5", /* 0x74 */
1289 "VK_F6", /* 0x75 */
1290 "VK_F7", /* 0x76 */
1291 "VK_F8", /* 0x77 */
1292 "VK_F9", /* 0x78 */
1293 "VK_F10", /* 0x79 */
1294 "VK_F11", /* 0x7A */
1295 "VK_F12", /* 0x7B */
1296 "VK_F13", /* 0x7C */
1297 "VK_F14", /* 0x7D */
1298 "VK_F15", /* 0x7E */
1299 "VK_F16", /* 0x7F */
1300 "VK_F17", /* 0x80 */
1301 "VK_F18", /* 0x81 */
1302 "VK_F19", /* 0x82 */
1303 "VK_F20", /* 0x83 */
1304 "VK_F21", /* 0x84 */
1305 "VK_F22", /* 0x85 */
1306 "VK_F23", /* 0x86 */
1307 "VK_F24", /* 0x87 */
1308 NULL, /* 0x88 */
1309 NULL, /* 0x89 */
1310 NULL, /* 0x8A */
1311 NULL, /* 0x8B */
1312 NULL, /* 0x8C */
1313 NULL, /* 0x8D */
1314 NULL, /* 0x8E */
1315 NULL, /* 0x8F */
1316 "VK_NUMLOCK", /* 0x90 */
1317 "VK_SCROLL", /* 0x91 */
1318 "VK_OEM_NEC_EQUAL", /* 0x92 aka. VK_OEM_FJ_JISHO */
1319 "VK_OEM_FJ_MASSHOU", /* 0x93 */
1320 "VK_OEM_FJ_TOUROKU", /* 0x94 */
1321 "VK_OEM_FJ_LOYA", /* 0x95 */
1322 "VK_OEM_FJ_ROYA", /* 0x96 */
1323 NULL, /* 0x97 */
1324 NULL, /* 0x98 */
1325 NULL, /* 0x99 */
1326 NULL, /* 0x9A */
1327 NULL, /* 0x9B */
1328 NULL, /* 0x9C */
1329 NULL, /* 0x9D */
1330 NULL, /* 0x9E */
1331 NULL, /* 0x9F */
1332 "VK_LSHIFT", /* 0xA0 */
1333 "VK_RSHIFT", /* 0xA1 */
1334 "VK_LCONTROL", /* 0xA2 */
1335 "VK_RCONTROL", /* 0xA3 */
1336 "VK_LMENU", /* 0xA4 */
1337 "VK_RMENU", /* 0xA5 */
1338 "VK_BROWSER_BACK", /* 0xA6 */
1339 "VK_BROWSER_FORWARD", /* 0xA7 */
1340 "VK_BROWSER_REFRESH", /* 0xA8 */
1341 "VK_BROWSER_STOP", /* 0xA9 */
1342 "VK_BROWSER_SEARCH", /* 0xAA */
1343 "VK_BROWSER_FAVORITES", /* 0xAB */
1344 "VK_BROWSER_HOME", /* 0xAC */
1345 "VK_VOLUME_MUTE", /* 0xAD */
1346 "VK_VOLUME_DOWN", /* 0xAE */
1347 "VK_VOLUME_UP", /* 0xAF */
1348 "VK_MEDIA_NEXT_TRACK", /* 0xB0 */
1349 "VK_MEDIA_PREV_TRACK", /* 0xB1 */
1350 "VK_MEDIA_STOP", /* 0xB2 */
1351 "VK_MEDIA_PLAY_PAUSE", /* 0xB3 */
1352 "VK_LAUNCH_MAIL", /* 0xB4 */
1353 "VK_LAUNCH_MEDIA_SELECT", /* 0xB5 */
1354 "VK_LAUNCH_APP1", /* 0xB6 */
1355 "VK_LAUNCH_APP2", /* 0xB7 */
1356 NULL, /* 0xB8 */
1357 NULL, /* 0xB9 */
1358 "VK_OEM_1", /* 0xBA */
1359 "VK_OEM_PLUS", /* 0xBB */
1360 "VK_OEM_COMMA", /* 0xBC */
1361 "VK_OEM_MINUS", /* 0xBD */
1362 "VK_OEM_PERIOD", /* 0xBE */
1363 "VK_OEM_2", /* 0xBF */
1364 "VK_OEM_3", /* 0xC0 */
1365 NULL, /* 0xC1 */
1366 NULL, /* 0xC2 */
1367 NULL, /* 0xC3 */
1368 NULL, /* 0xC4 */
1369 NULL, /* 0xC5 */
1370 NULL, /* 0xC6 */
1371 NULL, /* 0xC7 */
1372 NULL, /* 0xC8 */
1373 NULL, /* 0xC9 */
1374 NULL, /* 0xCA */
1375 NULL, /* 0xCB */
1376 NULL, /* 0xCC */
1377 NULL, /* 0xCD */
1378 NULL, /* 0xCE */
1379 NULL, /* 0xCF */
1380 NULL, /* 0xD0 */
1381 NULL, /* 0xD1 */
1382 NULL, /* 0xD2 */
1383 NULL, /* 0xD3 */
1384 NULL, /* 0xD4 */
1385 NULL, /* 0xD5 */
1386 NULL, /* 0xD6 */
1387 NULL, /* 0xD7 */
1388 NULL, /* 0xD8 */
1389 NULL, /* 0xD9 */
1390 NULL, /* 0xDA */
1391 "VK_OEM_4", /* 0xDB */
1392 "VK_OEM_5", /* 0xDC */
1393 "VK_OEM_6", /* 0xDD */
1394 "VK_OEM_7", /* 0xDE */
1395 "VK_OEM_8", /* 0xDF */
1396 NULL, /* 0xE0 */
1397 "VK_OEM_AX", /* 0xE1 */
1398 "VK_OEM_102", /* 0xE2 */
1399 "VK_ICO_HELP", /* 0xE3 */
1400 "VK_ICO_00", /* 0xE4 */
1401 "VK_PROCESSKEY", /* 0xE5 */
1402 NULL, /* 0xE6 */
1403 "VK_PACKET", /* 0xE7 */
1404 NULL, /* 0xE8 */
1405 NULL, /* 0xE9 */
1406 NULL, /* 0xEA */
1407 NULL, /* 0xEB */
1408 NULL, /* 0xEC */
1409 NULL, /* 0xED */
1410 NULL, /* 0xEE */
1411 NULL, /* 0xEF */
1412 NULL, /* 0xF0 */
1413 NULL, /* 0xF1 */
1414 NULL, /* 0xF2 */
1415 NULL, /* 0xF3 */
1416 NULL, /* 0xF4 */
1417 NULL, /* 0xF5 */
1418 "VK_ATTN", /* 0xF6 */
1419 "VK_CRSEL", /* 0xF7 */
1420 "VK_EXSEL", /* 0xF8 */
1421 "VK_EREOF", /* 0xF9 */
1422 "VK_PLAY", /* 0xFA */
1423 "VK_ZOOM", /* 0xFB */
1424 "VK_NONAME", /* 0xFC */
1425 "VK_PA1", /* 0xFD */
1426 "VK_OEM_CLEAR", /* 0xFE */
1427 NULL /* 0xFF */
1431 /************************************************************************/
1434 /* WM_USER+n message values for "common controls" */
1436 typedef struct
1438 const char *name; /* name of control message */
1439 UINT value; /* message number (0x0401-0x0fff */
1440 UINT len; /* length of space at lParam to dump */
1441 } USER_MSG;
1444 typedef struct
1446 const WCHAR *classname; /* class name to match */
1447 const USER_MSG *classmsg; /* pointer to first USER_MSG for class */
1448 UINT count; /* number of entries */
1449 } CONTROL_CLASS;
1451 #define USM(a,b) { #a ,a,b}
1452 #define SZOF(a) sizeof(a)
1454 /* To dump memory at the lParam for any of these messages, */
1455 /* replace the "0" with a "SZOF(structure)", or with a */
1456 /* number. (First method preferred.) */
1458 #define RB_GETBANDINFO_OLD (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */
1460 static const USER_MSG rebar_array[] = {
1461 USM(RB_INSERTBANDA, 0),
1462 USM(RB_DELETEBAND, 0),
1463 USM(RB_GETBARINFO, 0),
1464 USM(RB_SETBARINFO, 0),
1465 USM(RB_GETBANDINFO_OLD, 0),
1466 USM(RB_SETBANDINFOA, 0),
1467 USM(RB_SETPARENT, 0),
1468 USM(RB_HITTEST, 0),
1469 USM(RB_GETRECT, 0),
1470 USM(RB_INSERTBANDW, 0),
1471 USM(RB_SETBANDINFOW, 0),
1472 USM(RB_GETBANDCOUNT, 0),
1473 USM(RB_GETROWCOUNT, 0),
1474 USM(RB_GETROWHEIGHT, 0),
1475 USM(RB_IDTOINDEX, 0),
1476 USM(RB_GETTOOLTIPS, 0),
1477 USM(RB_SETTOOLTIPS, 0),
1478 USM(RB_SETBKCOLOR, 0),
1479 USM(RB_GETBKCOLOR, 0),
1480 USM(RB_SETTEXTCOLOR, 0),
1481 USM(RB_GETTEXTCOLOR, 0),
1482 USM(RB_SIZETORECT, 0),
1483 USM(RB_BEGINDRAG, 0),
1484 USM(RB_ENDDRAG, 0),
1485 USM(RB_DRAGMOVE, 0),
1486 USM(RB_GETBARHEIGHT, 0),
1487 USM(RB_GETBANDINFOW, 0),
1488 USM(RB_GETBANDINFOA, 0),
1489 USM(RB_MINIMIZEBAND, 0),
1490 USM(RB_MAXIMIZEBAND, 0),
1491 USM(RB_GETBANDBORDERS, 0),
1492 USM(RB_SHOWBAND, 0),
1493 USM(RB_SETPALETTE, 0),
1494 USM(RB_GETPALETTE, 0),
1495 USM(RB_MOVEBAND, 0),
1498 static const USER_MSG toolbar_array[] = {
1499 USM(TB_ENABLEBUTTON ,0),
1500 USM(TB_CHECKBUTTON ,0),
1501 USM(TB_PRESSBUTTON ,0),
1502 USM(TB_HIDEBUTTON ,0),
1503 USM(TB_INDETERMINATE ,0),
1504 USM(TB_MARKBUTTON ,0),
1505 USM(TB_ISBUTTONENABLED ,0),
1506 USM(TB_ISBUTTONCHECKED ,0),
1507 USM(TB_ISBUTTONPRESSED ,0),
1508 USM(TB_ISBUTTONHIDDEN ,0),
1509 USM(TB_ISBUTTONINDETERMINATE ,0),
1510 USM(TB_ISBUTTONHIGHLIGHTED ,0),
1511 USM(TB_SETSTATE ,0),
1512 USM(TB_GETSTATE ,0),
1513 USM(TB_ADDBITMAP ,0),
1514 USM(TB_ADDBUTTONSA ,0),
1515 USM(TB_INSERTBUTTONA ,0),
1516 USM(TB_DELETEBUTTON ,0),
1517 USM(TB_GETBUTTON ,0),
1518 USM(TB_BUTTONCOUNT ,0),
1519 USM(TB_COMMANDTOINDEX ,0),
1520 USM(TB_SAVERESTOREA ,0),
1521 USM(TB_CUSTOMIZE ,0),
1522 USM(TB_ADDSTRINGA ,0),
1523 USM(TB_GETITEMRECT ,0),
1524 USM(TB_BUTTONSTRUCTSIZE ,0),
1525 USM(TB_SETBUTTONSIZE ,0),
1526 USM(TB_SETBITMAPSIZE ,0),
1527 USM(TB_AUTOSIZE ,0),
1528 USM(TB_GETTOOLTIPS ,0),
1529 USM(TB_SETTOOLTIPS ,0),
1530 USM(TB_SETPARENT ,0),
1531 USM(TB_SETROWS ,0),
1532 USM(TB_GETROWS ,0),
1533 USM(TB_GETBITMAPFLAGS ,0),
1534 USM(TB_SETCMDID ,0),
1535 USM(TB_CHANGEBITMAP ,0),
1536 USM(TB_GETBITMAP ,0),
1537 USM(TB_GETBUTTONTEXTA ,0),
1538 USM(TB_REPLACEBITMAP ,0),
1539 USM(TB_SETINDENT ,0),
1540 USM(TB_SETIMAGELIST ,0),
1541 USM(TB_GETIMAGELIST ,0),
1542 USM(TB_LOADIMAGES ,0),
1543 USM(TB_GETRECT ,0),
1544 USM(TB_SETHOTIMAGELIST ,0),
1545 USM(TB_GETHOTIMAGELIST ,0),
1546 USM(TB_SETDISABLEDIMAGELIST ,0),
1547 USM(TB_GETDISABLEDIMAGELIST ,0),
1548 USM(TB_SETSTYLE ,0),
1549 USM(TB_GETSTYLE ,0),
1550 USM(TB_GETBUTTONSIZE ,0),
1551 USM(TB_SETBUTTONWIDTH ,0),
1552 USM(TB_SETMAXTEXTROWS ,0),
1553 USM(TB_GETTEXTROWS ,0),
1554 USM(TB_GETOBJECT ,0),
1555 USM(TB_GETBUTTONINFOW ,0),
1556 USM(TB_SETBUTTONINFOW ,0),
1557 USM(TB_GETBUTTONINFOA ,0),
1558 USM(TB_SETBUTTONINFOA ,0),
1559 USM(TB_INSERTBUTTONW ,0),
1560 USM(TB_ADDBUTTONSW ,0),
1561 USM(TB_HITTEST ,0),
1562 USM(TB_SETDRAWTEXTFLAGS ,0),
1563 USM(TB_GETHOTITEM ,0),
1564 USM(TB_SETHOTITEM ,0),
1565 USM(TB_SETANCHORHIGHLIGHT ,0),
1566 USM(TB_GETANCHORHIGHLIGHT ,0),
1567 USM(TB_GETBUTTONTEXTW ,0),
1568 USM(TB_SAVERESTOREW ,0),
1569 USM(TB_ADDSTRINGW ,0),
1570 USM(TB_MAPACCELERATORA ,0),
1571 USM(TB_GETINSERTMARK ,0),
1572 USM(TB_SETINSERTMARK ,0),
1573 USM(TB_INSERTMARKHITTEST ,0),
1574 USM(TB_MOVEBUTTON ,0),
1575 USM(TB_GETMAXSIZE ,0),
1576 USM(TB_SETEXTENDEDSTYLE ,0),
1577 USM(TB_GETEXTENDEDSTYLE ,0),
1578 USM(TB_GETPADDING ,0),
1579 USM(TB_SETPADDING ,0),
1580 USM(TB_SETINSERTMARKCOLOR ,0),
1581 USM(TB_GETINSERTMARKCOLOR ,0),
1582 USM(TB_MAPACCELERATORW ,0),
1583 USM(TB_GETSTRINGW ,0),
1584 USM(TB_GETSTRINGA ,0),
1585 USM(TB_SETBOUNDINGSIZE ,8),
1586 USM(TB_SETHOTITEM2 ,0),
1587 USM(TB_HASACCELERATOR ,0),
1588 USM(TB_SETLISTGAP ,0),
1589 USM(TB_GETIMAGELISTCOUNT ,0),
1590 USM(TB_GETIDEALSIZE ,8),
1591 USM(TB_UNKWN464 ,0),
1594 static const USER_MSG tooltips_array[] = {
1595 USM(TTM_ACTIVATE ,0),
1596 USM(TTM_SETDELAYTIME ,0),
1597 USM(TTM_ADDTOOLA ,0),
1598 USM(TTM_DELTOOLA ,0),
1599 USM(TTM_NEWTOOLRECTA ,0),
1600 USM(TTM_RELAYEVENT ,0),
1601 USM(TTM_GETTOOLINFOA ,0),
1602 USM(TTM_HITTESTA ,0),
1603 USM(TTM_GETTEXTA ,0),
1604 USM(TTM_UPDATETIPTEXTA ,0),
1605 USM(TTM_GETTOOLCOUNT ,0),
1606 USM(TTM_ENUMTOOLSA ,0),
1607 USM(TTM_GETCURRENTTOOLA ,0),
1608 USM(TTM_WINDOWFROMPOINT ,0),
1609 USM(TTM_TRACKACTIVATE ,0),
1610 USM(TTM_TRACKPOSITION ,0),
1611 USM(TTM_SETTIPBKCOLOR ,0),
1612 USM(TTM_SETTIPTEXTCOLOR ,0),
1613 USM(TTM_GETDELAYTIME ,0),
1614 USM(TTM_GETTIPBKCOLOR ,0),
1615 USM(TTM_GETTIPTEXTCOLOR ,0),
1616 USM(TTM_SETMAXTIPWIDTH ,0),
1617 USM(TTM_GETMAXTIPWIDTH ,0),
1618 USM(TTM_SETMARGIN ,0),
1619 USM(TTM_GETMARGIN ,0),
1620 USM(TTM_POP ,0),
1621 USM(TTM_UPDATE ,0),
1622 USM(TTM_GETBUBBLESIZE ,0),
1623 USM(TTM_ADDTOOLW ,0),
1624 USM(TTM_DELTOOLW ,0),
1625 USM(TTM_NEWTOOLRECTW ,0),
1626 USM(TTM_GETTOOLINFOW ,0),
1627 USM(TTM_SETTOOLINFOW ,0),
1628 USM(TTM_HITTESTW ,0),
1629 USM(TTM_GETTEXTW ,0),
1630 USM(TTM_UPDATETIPTEXTW ,0),
1631 USM(TTM_ENUMTOOLSW ,0),
1632 USM(TTM_GETCURRENTTOOLW ,0),
1635 static const USER_MSG comboex_array[] = {
1636 USM(CBEM_INSERTITEMA ,0),
1637 USM(CBEM_SETIMAGELIST ,0),
1638 USM(CBEM_GETIMAGELIST ,0),
1639 USM(CBEM_GETITEMA ,0),
1640 USM(CBEM_SETITEMA ,0),
1641 USM(CBEM_GETCOMBOCONTROL ,0),
1642 USM(CBEM_GETEDITCONTROL ,0),
1643 USM(CBEM_SETEXSTYLE ,0),
1644 USM(CBEM_GETEXTENDEDSTYLE ,0),
1645 USM(CBEM_HASEDITCHANGED ,0),
1646 USM(CBEM_INSERTITEMW ,0),
1647 USM(CBEM_SETITEMW ,0),
1648 USM(CBEM_GETITEMW ,0),
1649 USM(CBEM_SETEXTENDEDSTYLE ,0),
1652 static const USER_MSG propsht_array[] = {
1653 USM(PSM_SETCURSEL ,0),
1654 USM(PSM_REMOVEPAGE ,0),
1655 USM(PSM_ADDPAGE ,0),
1656 USM(PSM_CHANGED ,0),
1657 USM(PSM_RESTARTWINDOWS ,0),
1658 USM(PSM_REBOOTSYSTEM ,0),
1659 USM(PSM_CANCELTOCLOSE ,0),
1660 USM(PSM_QUERYSIBLINGS ,0),
1661 USM(PSM_UNCHANGED ,0),
1662 USM(PSM_APPLY ,0),
1663 USM(PSM_SETTITLEA ,0),
1664 USM(PSM_SETWIZBUTTONS ,0),
1665 USM(PSM_PRESSBUTTON ,0),
1666 USM(PSM_SETCURSELID ,0),
1667 USM(PSM_SETFINISHTEXTA ,0),
1668 USM(PSM_GETTABCONTROL ,0),
1669 USM(PSM_ISDIALOGMESSAGE ,0),
1670 USM(PSM_GETCURRENTPAGEHWND ,0),
1671 USM(PSM_SETTITLEW ,0),
1672 USM(PSM_SETFINISHTEXTW ,0),
1674 static const USER_MSG updown_array[] = {
1675 USM(UDM_SETRANGE ,0),
1676 USM(UDM_GETRANGE ,0),
1677 USM(UDM_SETPOS ,0),
1678 USM(UDM_GETPOS ,0),
1679 USM(UDM_SETBUDDY ,0),
1680 USM(UDM_GETBUDDY ,0),
1681 USM(UDM_SETACCEL ,0),
1682 USM(UDM_GETACCEL ,0),
1683 USM(UDM_SETBASE ,0),
1684 USM(UDM_GETBASE ,0),
1685 USM(UDM_SETRANGE32 ,0),
1686 USM(UDM_GETRANGE32 ,0),
1687 USM(UDM_SETPOS32 ,0),
1688 USM(UDM_GETPOS32 ,0),
1691 /* generated from:
1692 * $ for i in `grep EM_ include/richedit.h | cut -d' ' -f2 | cut -f1`; do echo -e " USM($i\t\t,0),"; done
1694 static const USER_MSG richedit_array[] = {
1695 {"EM_SCROLLCARET", WM_USER+49 ,0},
1696 USM(EM_CANPASTE ,0),
1697 USM(EM_DISPLAYBAND ,0),
1698 USM(EM_EXGETSEL ,0),
1699 USM(EM_EXLIMITTEXT ,0),
1700 USM(EM_EXLINEFROMCHAR ,0),
1701 USM(EM_EXSETSEL ,0),
1702 USM(EM_FINDTEXT ,0),
1703 USM(EM_FORMATRANGE ,0),
1704 USM(EM_GETCHARFORMAT ,0),
1705 USM(EM_GETEVENTMASK ,0),
1706 USM(EM_GETOLEINTERFACE ,0),
1707 USM(EM_GETPARAFORMAT ,0),
1708 USM(EM_GETSELTEXT ,0),
1709 USM(EM_HIDESELECTION ,0),
1710 USM(EM_PASTESPECIAL ,0),
1711 USM(EM_REQUESTRESIZE ,0),
1712 USM(EM_SELECTIONTYPE ,0),
1713 USM(EM_SETBKGNDCOLOR ,0),
1714 USM(EM_SETCHARFORMAT ,0),
1715 USM(EM_SETEVENTMASK ,0),
1716 USM(EM_SETOLECALLBACK ,0),
1717 USM(EM_SETPARAFORMAT ,0),
1718 USM(EM_SETTARGETDEVICE ,0),
1719 USM(EM_STREAMIN ,0),
1720 USM(EM_STREAMOUT ,0),
1721 USM(EM_GETTEXTRANGE ,0),
1722 USM(EM_FINDWORDBREAK ,0),
1723 USM(EM_SETOPTIONS ,0),
1724 USM(EM_GETOPTIONS ,0),
1725 USM(EM_FINDTEXTEX ,0),
1726 USM(EM_GETWORDBREAKPROCEX ,0),
1727 USM(EM_SETWORDBREAKPROCEX ,0),
1728 USM(EM_SETUNDOLIMIT ,0),
1729 USM(EM_REDO ,0),
1730 USM(EM_CANREDO ,0),
1731 USM(EM_GETUNDONAME ,0),
1732 USM(EM_GETREDONAME ,0),
1733 USM(EM_STOPGROUPTYPING ,0),
1734 USM(EM_SETTEXTMODE ,0),
1735 USM(EM_GETTEXTMODE ,0),
1736 USM(EM_AUTOURLDETECT ,0),
1737 USM(EM_GETAUTOURLDETECT ,0),
1738 USM(EM_SETPALETTE ,0),
1739 USM(EM_GETTEXTEX ,0),
1740 USM(EM_GETTEXTLENGTHEX ,0),
1741 USM(EM_SHOWSCROLLBAR ,0),
1742 USM(EM_SETTEXTEX ,0),
1743 USM(EM_SETPUNCTUATION ,0),
1744 USM(EM_GETPUNCTUATION ,0),
1745 USM(EM_SETWORDWRAPMODE ,0),
1746 USM(EM_GETWORDWRAPMODE ,0),
1747 USM(EM_SETIMECOLOR ,0),
1748 USM(EM_GETIMECOLOR ,0),
1749 USM(EM_SETIMEOPTIONS ,0),
1750 USM(EM_GETIMEOPTIONS ,0),
1751 USM(EM_CONVPOSITION ,0),
1752 USM(EM_SETLANGOPTIONS ,0),
1753 USM(EM_GETLANGOPTIONS ,0),
1754 USM(EM_GETIMECOMPMODE ,0),
1755 USM(EM_FINDTEXTW ,0),
1756 USM(EM_FINDTEXTEXW ,0),
1757 USM(EM_RECONVERSION ,0),
1758 USM(EM_SETIMEMODEBIAS ,0),
1759 USM(EM_GETIMEMODEBIAS ,0),
1760 USM(EM_SETBIDIOPTIONS ,0),
1761 USM(EM_GETBIDIOPTIONS ,0),
1762 USM(EM_SETTYPOGRAPHYOPTIONS ,0),
1763 USM(EM_GETTYPOGRAPHYOPTIONS ,0),
1764 USM(EM_SETEDITSTYLE ,0),
1765 USM(EM_GETEDITSTYLE ,0),
1766 USM(EM_OUTLINE ,0),
1767 USM(EM_GETSCROLLPOS ,0),
1768 USM(EM_SETSCROLLPOS ,0),
1769 USM(EM_SETFONTSIZE ,0),
1770 USM(EM_GETZOOM ,0),
1771 USM(EM_SETZOOM ,0),
1774 #undef SZOF
1775 #undef USM
1777 static const CONTROL_CLASS cc_array[] = {
1778 {WC_COMBOBOXEXW, comboex_array, ARRAY_SIZE(comboex_array)},
1779 {WC_PROPSHEETW, propsht_array, ARRAY_SIZE(propsht_array)},
1780 {REBARCLASSNAMEW, rebar_array, ARRAY_SIZE(rebar_array)},
1781 {TOOLBARCLASSNAMEW, toolbar_array, ARRAY_SIZE(toolbar_array)},
1782 {TOOLTIPS_CLASSW, tooltips_array, ARRAY_SIZE(tooltips_array)},
1783 {UPDOWN_CLASSW, updown_array, ARRAY_SIZE(updown_array)},
1784 {RICHEDIT_CLASS20W, richedit_array, ARRAY_SIZE(richedit_array)},
1785 {0, 0, 0}
1789 /************************************************************************/
1792 /* WM_NOTIFY function codes display */
1794 typedef struct
1796 const char *name; /* name of notify message */
1797 UINT value; /* notify code value */
1798 UINT len; /* length of extra space to dump */
1799 } SPY_NOTIFY;
1801 #define SPNFY(a,b) { #a ,a,sizeof(b)-sizeof(NMHDR)}
1803 /* Array MUST be in descending order by the 'value' field */
1804 /* (since value is UNSIGNED, 0xffffffff is largest and */
1805 /* 0xfffffffe is smaller). A binary search is used to */
1806 /* locate the correct 'value'. */
1807 static const SPY_NOTIFY spnfy_array[] = {
1808 /* common 0U to 0U-99U */
1809 SPNFY(NM_OUTOFMEMORY, NMHDR),
1810 SPNFY(NM_CLICK, NMHDR),
1811 SPNFY(NM_DBLCLK, NMHDR),
1812 SPNFY(NM_RETURN, NMHDR),
1813 SPNFY(NM_RCLICK, NMHDR),
1814 SPNFY(NM_RDBLCLK, NMHDR),
1815 SPNFY(NM_SETFOCUS, NMHDR),
1816 SPNFY(NM_KILLFOCUS, NMHDR),
1817 SPNFY(NM_CUSTOMDRAW, NMCUSTOMDRAW),
1818 SPNFY(NM_HOVER, NMHDR),
1819 SPNFY(NM_NCHITTEST, NMMOUSE),
1820 SPNFY(NM_KEYDOWN, NMKEY),
1821 SPNFY(NM_RELEASEDCAPTURE, NMHDR),
1822 SPNFY(NM_SETCURSOR, NMMOUSE),
1823 SPNFY(NM_CHAR, NMCHAR),
1824 SPNFY(NM_TOOLTIPSCREATED, NMTOOLTIPSCREATED),
1825 /* Listview 0U-100U to 0U-199U */
1826 SPNFY(LVN_ITEMCHANGING, NMLISTVIEW),
1827 SPNFY(LVN_ITEMCHANGED, NMLISTVIEW),
1828 SPNFY(LVN_INSERTITEM, NMLISTVIEW),
1829 SPNFY(LVN_DELETEITEM, NMLISTVIEW),
1830 SPNFY(LVN_DELETEALLITEMS, NMLISTVIEW),
1831 SPNFY(LVN_BEGINLABELEDITA, NMLVDISPINFOA),
1832 SPNFY(LVN_ENDLABELEDITA, NMLVDISPINFOA),
1833 SPNFY(LVN_COLUMNCLICK, NMLISTVIEW),
1834 SPNFY(LVN_BEGINDRAG, NMLISTVIEW),
1835 SPNFY(LVN_BEGINRDRAG, NMLISTVIEW),
1836 SPNFY(LVN_ODCACHEHINT, NMLVCACHEHINT),
1837 SPNFY(LVN_ITEMACTIVATE, NMITEMACTIVATE),
1838 SPNFY(LVN_ODSTATECHANGED, NMLVODSTATECHANGE),
1839 SPNFY(LVN_HOTTRACK, NMLISTVIEW),
1840 SPNFY(LVN_GETDISPINFOA, NMLVDISPINFOA),
1841 SPNFY(LVN_SETDISPINFOA, NMLVDISPINFOA),
1842 SPNFY(LVN_ODFINDITEMA, NMLVFINDITEMA),
1843 SPNFY(LVN_KEYDOWN, NMLVKEYDOWN),
1844 SPNFY(LVN_MARQUEEBEGIN, NMLISTVIEW),
1845 SPNFY(LVN_GETINFOTIPA, NMLVGETINFOTIPA),
1846 SPNFY(LVN_GETINFOTIPW, NMLVGETINFOTIPW),
1847 SPNFY(LVN_BEGINLABELEDITW, NMLVDISPINFOW),
1848 SPNFY(LVN_ENDLABELEDITW, NMLVDISPINFOW),
1849 SPNFY(LVN_GETDISPINFOW, NMLVDISPINFOW),
1850 SPNFY(LVN_SETDISPINFOW, NMLVDISPINFOW),
1851 SPNFY(LVN_ODFINDITEMW, NMLVFINDITEMW),
1852 /* PropertySheet 0U-200U to 0U-299U */
1853 SPNFY(PSN_SETACTIVE, PSHNOTIFY),
1854 SPNFY(PSN_KILLACTIVE, PSHNOTIFY),
1855 SPNFY(PSN_APPLY, PSHNOTIFY),
1856 SPNFY(PSN_RESET, PSHNOTIFY),
1857 SPNFY(PSN_HELP, PSHNOTIFY),
1858 SPNFY(PSN_WIZBACK, PSHNOTIFY),
1859 SPNFY(PSN_WIZNEXT, PSHNOTIFY),
1860 SPNFY(PSN_WIZFINISH, PSHNOTIFY),
1861 SPNFY(PSN_QUERYCANCEL, PSHNOTIFY),
1862 SPNFY(PSN_GETOBJECT, NMOBJECTNOTIFY),
1863 SPNFY(PSN_TRANSLATEACCELERATOR, PSHNOTIFY),
1864 SPNFY(PSN_QUERYINITIALFOCUS, PSHNOTIFY),
1865 /* Header 0U-300U to 0U-399U */
1866 SPNFY(HDN_ITEMCHANGINGA, NMHEADERA),
1867 SPNFY(HDN_ITEMCHANGEDA, NMHEADERA),
1868 SPNFY(HDN_ITEMCLICKA, NMHEADERA),
1869 SPNFY(HDN_ITEMDBLCLICKA, NMHEADERA),
1870 SPNFY(HDN_DIVIDERDBLCLICKA, NMHEADERA),
1871 SPNFY(HDN_BEGINTRACKA, NMHEADERA),
1872 SPNFY(HDN_ENDTRACKA, NMHEADERA),
1873 SPNFY(HDN_TRACKA, NMHEADERA),
1874 SPNFY(HDN_GETDISPINFOA, NMHEADERA),
1875 SPNFY(HDN_BEGINDRAG, NMHDR),
1876 SPNFY(HDN_ENDDRAG, NMHDR),
1877 SPNFY(HDN_ITEMCHANGINGW, NMHDR),
1878 SPNFY(HDN_ITEMCHANGEDW, NMHDR),
1879 SPNFY(HDN_ITEMCLICKW, NMHDR),
1880 SPNFY(HDN_ITEMDBLCLICKW, NMHDR),
1881 SPNFY(HDN_DIVIDERDBLCLICKW, NMHDR),
1882 SPNFY(HDN_BEGINTRACKW, NMHDR),
1883 SPNFY(HDN_ENDTRACKW, NMHDR),
1884 SPNFY(HDN_TRACKW, NMHDR),
1885 SPNFY(HDN_GETDISPINFOW, NMHDR),
1886 /* Treeview 0U-400U to 0U-499U */
1887 SPNFY(TVN_SELCHANGINGA, NMTREEVIEWA),
1888 SPNFY(TVN_SELCHANGEDA, NMTREEVIEWA),
1889 SPNFY(TVN_GETDISPINFOA, NMTVDISPINFOA),
1890 SPNFY(TVN_SETDISPINFOA, NMTVDISPINFOA),
1891 SPNFY(TVN_ITEMEXPANDINGA, NMTREEVIEWA),
1892 SPNFY(TVN_ITEMEXPANDEDA, NMTREEVIEWA),
1893 SPNFY(TVN_BEGINDRAGA, NMTREEVIEWA),
1894 SPNFY(TVN_BEGINRDRAGA, NMTREEVIEWA),
1895 SPNFY(TVN_DELETEITEMA, NMTREEVIEWA),
1896 SPNFY(TVN_BEGINLABELEDITA, NMTVDISPINFOA),
1897 SPNFY(TVN_ENDLABELEDITA, NMTVDISPINFOA),
1898 SPNFY(TVN_KEYDOWN, NMTVKEYDOWN),
1899 SPNFY(TVN_SELCHANGINGW, NMTREEVIEWW),
1900 SPNFY(TVN_SELCHANGEDW, NMTREEVIEWW),
1901 SPNFY(TVN_GETDISPINFOW, NMTVDISPINFOW),
1902 SPNFY(TVN_SETDISPINFOW, NMTVDISPINFOW),
1903 SPNFY(TVN_ITEMEXPANDINGW, NMTREEVIEWW),
1904 SPNFY(TVN_ITEMEXPANDEDW, NMTREEVIEWW),
1905 SPNFY(TVN_BEGINDRAGW, NMTREEVIEWW),
1906 SPNFY(TVN_BEGINRDRAGW, NMTREEVIEWW),
1907 SPNFY(TVN_DELETEITEMW, NMTREEVIEWW),
1908 SPNFY(TVN_BEGINLABELEDITW, NMTVDISPINFOW),
1909 SPNFY(TVN_ENDLABELEDITW, NMTVDISPINFOW),
1910 /* Tooltips 0U-520U to 0U-549U */
1911 SPNFY(TTN_GETDISPINFOA, NMHDR),
1912 SPNFY(TTN_SHOW, NMHDR),
1913 SPNFY(TTN_POP, NMHDR),
1914 SPNFY(TTN_GETDISPINFOW, NMHDR),
1915 /* Tab 0U-550U to 0U-580U */
1916 SPNFY(TCN_KEYDOWN, NMHDR),
1917 SPNFY(TCN_SELCHANGE, NMHDR),
1918 SPNFY(TCN_SELCHANGING, NMHDR),
1919 SPNFY(TCN_GETOBJECT, NMHDR),
1920 /* Common Dialog 0U-601U to 0U-699U */
1921 SPNFY(CDN_INITDONE, OFNOTIFYA),
1922 SPNFY(CDN_SELCHANGE, OFNOTIFYA),
1923 SPNFY(CDN_FOLDERCHANGE, OFNOTIFYA),
1924 SPNFY(CDN_SHAREVIOLATION, OFNOTIFYA),
1925 SPNFY(CDN_HELP, OFNOTIFYA),
1926 SPNFY(CDN_FILEOK, OFNOTIFYA),
1927 SPNFY(CDN_TYPECHANGE, OFNOTIFYA),
1928 /* Toolbar 0U-700U to 0U-720U */
1929 SPNFY(TBN_GETBUTTONINFOA, NMTOOLBARA),
1930 SPNFY(TBN_BEGINDRAG, NMTOOLBARA),
1931 SPNFY(TBN_ENDDRAG, NMTOOLBARA),
1932 SPNFY(TBN_BEGINADJUST, NMHDR),
1933 SPNFY(TBN_ENDADJUST, NMHDR),
1934 SPNFY(TBN_RESET, NMHDR),
1935 SPNFY(TBN_QUERYINSERT, NMTOOLBARA),
1936 SPNFY(TBN_QUERYDELETE, NMTOOLBARA),
1937 SPNFY(TBN_TOOLBARCHANGE, NMHDR),
1938 SPNFY(TBN_CUSTHELP, NMHDR),
1939 SPNFY(TBN_DROPDOWN, NMTOOLBARA),
1940 SPNFY(TBN_GETOBJECT, NMOBJECTNOTIFY),
1941 SPNFY(TBN_HOTITEMCHANGE, NMTBHOTITEM),
1942 SPNFY(TBN_DRAGOUT, NMTOOLBARA),
1943 SPNFY(TBN_DELETINGBUTTON, NMTOOLBARA),
1944 SPNFY(TBN_GETDISPINFOA, NMTBDISPINFOA),
1945 SPNFY(TBN_GETDISPINFOW, NMTBDISPINFOW),
1946 SPNFY(TBN_GETINFOTIPA, NMTBGETINFOTIPA),
1947 SPNFY(TBN_GETINFOTIPW, NMTBGETINFOTIPW),
1948 SPNFY(TBN_GETBUTTONINFOW, NMTOOLBARW),
1949 /* Up/Down 0U-721U to 0U-740U */
1950 SPNFY(UDN_DELTAPOS, NM_UPDOWN),
1951 /* Month Calendar 0U-750U to 0U-759U */
1952 /* ******************* WARNING ***************************** */
1953 /* The following appear backwards but needs to be this way. */
1954 /* The reason is that MS (and us) define the MCNs as */
1955 /* MCN_FIRST + n */
1956 /* instead of the way ALL other notifications are */
1957 /* TBN_FIRST - n */
1958 /* The only place that this is important is in this list */
1959 /* */
1960 /* Also since the same error was made with the DTN_ items, */
1961 /* they overlay the MCN_ and need to be inserted in the */
1962 /* other section of the table so that it is in order for */
1963 /* the binary search. */
1964 /* */
1965 /* Thank you MS for your obvious quality control!! */
1966 /* ******************* WARNING ***************************** */
1967 /* Date/Time 0U-760U to 0U-799U */
1968 /* SPNFY(MCN_SELECT, NMHDR), */
1969 /* SPNFY(MCN_GETDAYSTATE, NMHDR), */
1970 /* SPNFY(MCN_SELCHANGE, NMHDR), */
1971 /* ******************* WARNING ***************************** */
1972 /* The following appear backwards but needs to be this way. */
1973 /* The reason is that MS (and us) define the MCNs as */
1974 /* DTN_FIRST + n */
1975 /* instead of the way ALL other notifications are */
1976 /* TBN_FIRST - n */
1977 /* The only place that this is important is in this list */
1978 /* ******************* WARNING ***************************** */
1979 SPNFY(DTN_FORMATQUERYW, NMHDR),
1980 SPNFY(DTN_FORMATW, NMHDR),
1981 SPNFY(DTN_WMKEYDOWNW, NMHDR),
1982 SPNFY(DTN_USERSTRINGW, NMHDR),
1983 SPNFY(MCN_SELECT, NMHDR),
1984 SPNFY(MCN_GETDAYSTATE, NMHDR),
1985 SPNFY(MCN_SELCHANGE, NMHDR),
1986 SPNFY(DTN_CLOSEUP, NMHDR),
1987 SPNFY(DTN_DROPDOWN, NMHDR),
1988 SPNFY(DTN_FORMATQUERYA, NMHDR),
1989 SPNFY(DTN_FORMATA, NMHDR),
1990 SPNFY(DTN_WMKEYDOWNA, NMHDR),
1991 SPNFY(DTN_USERSTRINGA, NMHDR),
1992 SPNFY(DTN_DATETIMECHANGE, NMHDR),
1993 /* ComboBoxEx 0U-800U to 0U-830U */
1994 SPNFY(CBEN_GETDISPINFOA, NMCOMBOBOXEXA),
1995 SPNFY(CBEN_INSERTITEM, NMCOMBOBOXEXA),
1996 SPNFY(CBEN_DELETEITEM, NMCOMBOBOXEXA),
1997 SPNFY(CBEN_BEGINEDIT, NMHDR),
1998 SPNFY(CBEN_ENDEDITA, NMCBEENDEDITA),
1999 SPNFY(CBEN_ENDEDITW, NMCBEENDEDITW),
2000 SPNFY(CBEN_GETDISPINFOW, NMCOMBOBOXEXW),
2001 SPNFY(CBEN_DRAGBEGINA, NMCBEDRAGBEGINA),
2002 SPNFY(CBEN_DRAGBEGINW, NMCBEDRAGBEGINW),
2003 /* Rebar 0U-831U to 0U-859U */
2004 SPNFY(RBN_HEIGHTCHANGE, NMHDR),
2005 SPNFY(RBN_GETOBJECT, NMOBJECTNOTIFY),
2006 SPNFY(RBN_LAYOUTCHANGED, NMHDR),
2007 SPNFY(RBN_AUTOSIZE, NMRBAUTOSIZE),
2008 SPNFY(RBN_BEGINDRAG, NMREBAR),
2009 SPNFY(RBN_ENDDRAG, NMREBAR),
2010 SPNFY(RBN_DELETINGBAND, NMREBAR),
2011 SPNFY(RBN_DELETEDBAND, NMREBAR),
2012 SPNFY(RBN_CHILDSIZE, NMREBARCHILDSIZE),
2013 /* IP address 0U-860U to 0U-879U */
2014 SPNFY(IPN_FIELDCHANGED, NMHDR),
2015 /* Status bar 0U-880U to 0U-899U */
2016 SPNFY(SBN_SIMPLEMODECHANGE, NMHDR),
2017 /* Pager 0U-900U to 0U-950U */
2018 SPNFY(PGN_SCROLL, NMPGSCROLL),
2019 SPNFY(PGN_CALCSIZE, NMPGCALCSIZE),
2021 #undef SPNFY
2023 static unsigned char *spy_exclude;
2025 static inline BOOL exclude_msg( UINT msg )
2027 return spy_exclude[ min( msg, SPY_MAX_MSGNUM ) ];
2030 static inline BOOL exclude_dwp(void)
2032 return spy_exclude[SPY_MAX_MSGNUM + 1];
2036 typedef struct
2038 UINT msgnum; /* message number */
2039 HWND msg_hwnd; /* window handle for message */
2040 WPARAM wParam; /* message parameter */
2041 LPARAM lParam; /* message parameter */
2042 INT data_len; /* length of data to dump */
2043 char msg_name[60]; /* message name (see SPY_GetMsgName) */
2044 WCHAR wnd_class[60]; /* window class name (full) */
2045 WCHAR wnd_name[16]; /* window name for message */
2046 } SPY_INSTANCE;
2048 static int indent_tls_index = TLS_OUT_OF_INDEXES;
2050 /***********************************************************************
2051 * get_indent_level
2053 static inline INT_PTR get_indent_level(void)
2055 return (INT_PTR)TlsGetValue( indent_tls_index );
2059 /***********************************************************************
2060 * set_indent_level
2062 static inline void set_indent_level( INT_PTR level )
2064 TlsSetValue( indent_tls_index, (void *)level );
2068 /***********************************************************************
2069 * SPY_GetMsgInternal
2071 static const char *SPY_GetMsgInternal( UINT msg )
2073 if (msg <= SPY_MAX_MSGNUM)
2074 return MessageTypeNames[msg];
2076 if (msg >= LVM_FIRST && msg <= LVM_FIRST + SPY_MAX_LVMMSGNUM)
2077 return LVMMessageTypeNames[msg-LVM_FIRST];
2079 if (msg >= TV_FIRST && msg <= TV_FIRST + SPY_MAX_TVMSGNUM)
2080 return TVMessageTypeNames[msg-TV_FIRST];
2082 if (msg >= HDM_FIRST && msg <= HDM_FIRST + SPY_MAX_HDMMSGNUM)
2083 return HDMMessageTypeNames[msg-HDM_FIRST];
2085 if (msg >= TCM_FIRST && msg <= TCM_FIRST + SPY_MAX_TCMMSGNUM)
2086 return TCMMessageTypeNames[msg-TCM_FIRST];
2088 if (msg >= PGM_FIRST && msg <= PGM_FIRST + SPY_MAX_PGMMSGNUM)
2089 return PGMMessageTypeNames[msg-PGM_FIRST];
2091 if (msg >= CCM_FIRST && msg <= CCM_FIRST + SPY_MAX_CCMMSGNUM)
2092 return CCMMessageTypeNames[msg-CCM_FIRST];
2094 if (msg >= WM_WINE_DESTROYWINDOW && msg <= WM_WINE_DESTROYWINDOW + SPY_MAX_WINEMSGNUM)
2095 return WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW];
2097 return NULL;
2100 /***********************************************************************
2101 * SPY_Bsearch_Msg
2103 static const USER_MSG *SPY_Bsearch_Msg( const USER_MSG *msgs, UINT count, UINT code)
2105 int low = 0, high = count - 1;
2107 while (low <= high)
2109 int idx = (low + high) / 2;
2110 if (msgs[idx].value == code) return msgs + idx;
2111 if (msgs[idx].value > code)
2112 high = idx - 1;
2113 else
2114 low = idx + 1;
2116 return NULL;
2119 /***********************************************************************
2120 * SPY_GetClassLongOffsetName
2122 * Gets the name of a class long offset.
2124 const char *SPY_GetClassLongOffsetName( INT offset )
2126 INT index;
2127 if (offset < 0 && offset % 2 == 0 && ((index = -(offset + 8) / 2) <
2128 ARRAY_SIZE(ClassLongOffsetNames)))
2130 return ClassLongOffsetNames[index];
2133 return "?";
2136 /***********************************************************************
2137 * SPY_GetClassName
2139 * Sets the value of "wnd_class" member of the instance structure.
2141 static void SPY_GetClassName( SPY_INSTANCE *sp_e )
2143 /* special code to detect a property sheet dialog */
2144 if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == WC_DIALOG) &&
2145 (GetPropW(sp_e->msg_hwnd, L"PropertySheetInfo"))) {
2146 lstrcpyW(sp_e->wnd_class, WC_PROPSHEETW);
2148 else {
2149 GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, ARRAY_SIZE(sp_e->wnd_class));
2153 /***********************************************************************
2154 * SPY_GetMsgStuff
2156 * Get message name and other information for dumping
2158 static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
2160 const USER_MSG *p;
2161 const char *msg_name = SPY_GetMsgInternal( sp_e->msgnum );
2163 sp_e->data_len = 0;
2164 if (!msg_name)
2166 INT i = 0;
2168 if (sp_e->msgnum >= 0xc000)
2170 if (GlobalGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
2172 sp_e->msg_name[0] = '\"';
2173 strcat( sp_e->msg_name, "\"" );
2174 return;
2177 if (!sp_e->wnd_class[0]) SPY_GetClassName(sp_e);
2179 #if DEBUG_SPY
2180 TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class));
2181 #endif
2183 while (cc_array[i].classname &&
2184 wcsicmp(cc_array[i].classname, sp_e->wnd_class) != 0) i++;
2186 if (cc_array[i].classname)
2188 #if DEBUG_SPY
2189 TRACE("process class %s, first %p, last %p\n",
2190 debugstr_w(cc_array[i].classname), cc_array[i].classmsg,
2191 cc_array[i].lastmsg);
2192 #endif
2193 p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].count, sp_e->msgnum);
2194 if (p) {
2195 lstrcpynA (sp_e->msg_name, p->name, sizeof(sp_e->msg_name));
2196 sp_e->data_len = p->len;
2197 return;
2200 if (sp_e->msgnum >= WM_USER && sp_e->msgnum <= WM_APP)
2201 sprintf( sp_e->msg_name, "WM_USER+%d", sp_e->msgnum - WM_USER );
2202 else
2203 sprintf( sp_e->msg_name, "%04x", sp_e->msgnum );
2205 else
2207 lstrcpynA(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name));
2211 /***********************************************************************
2212 * SPY_GetWndName
2214 * Sets the value of "wnd_name" and "wnd_class" members of the
2215 * instance structure.
2218 static void SPY_GetWndName( SPY_INSTANCE *sp_e )
2220 INT len;
2222 SPY_GetClassName( sp_e );
2224 len = InternalGetWindowText(sp_e->msg_hwnd, sp_e->wnd_name, ARRAY_SIZE(sp_e->wnd_name));
2225 if(!len) /* get class name */
2227 LPWSTR dst = sp_e->wnd_name;
2228 LPWSTR src = sp_e->wnd_class;
2229 int n = ARRAY_SIZE(sp_e->wnd_name) - 3;
2230 *dst++ = '{';
2231 while ((n-- > 0) && *src) *dst++ = *src++;
2232 *dst++ = '}';
2233 *dst = 0;
2237 /***********************************************************************
2238 * SPY_GetMsgName
2240 * **** External function ****
2242 * Get message name
2244 const char *SPY_GetMsgName( UINT msg, HWND hWnd )
2246 SPY_INSTANCE ext_sp_e;
2247 DWORD save_error = GetLastError();
2249 ext_sp_e.msgnum = msg;
2250 ext_sp_e.msg_hwnd = hWnd;
2251 ext_sp_e.lParam = 0;
2252 ext_sp_e.wParam = 0;
2253 ext_sp_e.wnd_class[0] = 0;
2254 SPY_GetMsgStuff(&ext_sp_e);
2255 SetLastError( save_error );
2256 return wine_dbg_sprintf("%s", ext_sp_e.msg_name);
2259 /***********************************************************************
2260 * SPY_GetVKeyName
2262 const char *SPY_GetVKeyName(WPARAM wParam)
2264 const char *vk_key_name;
2266 if(wParam <= SPY_MAX_VKKEYSNUM && VK_KeyNames[wParam])
2267 vk_key_name = VK_KeyNames[wParam];
2268 else
2269 vk_key_name = "VK_???";
2271 return vk_key_name;
2274 /***********************************************************************
2275 * SPY_Bsearch_Notify
2277 static const SPY_NOTIFY *SPY_Bsearch_Notify( UINT code)
2279 int low = 0, high = ARRAY_SIZE(spnfy_array) - 1;
2281 while (low <= high)
2283 int idx = (low + high) / 2;
2284 if (spnfy_array[idx].value == code) return spnfy_array + idx;
2285 if (spnfy_array[idx].value < code)
2286 high = idx - 1;
2287 else
2288 low = idx + 1;
2290 return NULL;
2293 /***********************************************************************
2294 * SPY_DumpMem
2296 static void SPY_DumpMem (LPCSTR header, const UINT *q, INT len)
2298 int i;
2300 for(i=0; i<len-12; i+=16) {
2301 TRACE("%s [%04x] %08x %08x %08x %08x\n",
2302 header, i, *q, *(q+1), *(q+2), *(q+3));
2303 q += 4;
2305 switch ((len - i + 3) & (~3)) {
2306 case 16:
2307 TRACE("%s [%04x] %08x %08x %08x %08x\n",
2308 header, i, *q, *(q+1), *(q+2), *(q+3));
2309 break;
2310 case 12:
2311 TRACE("%s [%04x] %08x %08x %08x\n",
2312 header, i, *q, *(q+1), *(q+2));
2313 break;
2314 case 8:
2315 TRACE("%s [%04x] %08x %08x\n",
2316 header, i, *q, *(q+1));
2317 break;
2318 case 4:
2319 TRACE("%s [%04x] %08x\n",
2320 header, i, *q);
2321 break;
2322 default:
2323 break;
2327 /***********************************************************************
2328 * SPY_DumpStructure
2330 static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
2332 switch (sp_e->msgnum)
2334 case LVM_INSERTITEMW:
2335 case LVM_SETITEMW:
2336 if (!enter) break;
2337 /* fall through */
2338 case LVM_GETITEMW:
2340 LPLVITEMA item = (LPLVITEMA) sp_e->lParam;
2341 if (item) {
2342 SPY_DumpMem ("LVITEM", (UINT*)item, sizeof(LVITEMA));
2344 break;
2346 case TCM_INSERTITEMW:
2347 case TCM_INSERTITEMA:
2348 case TCM_SETITEMW:
2349 case TCM_SETITEMA:
2350 if (!enter) break;
2351 /* fall through */
2352 case TCM_GETITEMW:
2353 case TCM_GETITEMA:
2355 TCITEMA *item = (TCITEMA *) sp_e->lParam;
2356 if (item) {
2357 SPY_DumpMem ("TCITEM", (UINT*)item, sizeof(TCITEMA));
2359 break;
2361 case TCM_ADJUSTRECT:
2362 case LVM_GETITEMRECT:
2363 case LVM_GETSUBITEMRECT:
2365 LPRECT rc = (LPRECT) sp_e->lParam;
2366 if (rc)
2367 TRACE("lParam rect (%s)\n", wine_dbgstr_rect(rc));
2368 break;
2370 case LVM_SETITEMPOSITION32:
2371 if (!enter) break;
2372 /* fall through */
2373 case LVM_GETITEMPOSITION:
2374 case LVM_GETORIGIN:
2376 LPPOINT point = (LPPOINT) sp_e->lParam;
2377 if (point) {
2378 TRACE("lParam point x=%d, y=%d\n", point->x, point->y);
2380 break;
2382 case SBM_SETRANGE:
2383 if (!enter && (sp_e->msgnum == SBM_SETRANGE)) break;
2384 TRACE("min=%d max=%d\n", (INT)sp_e->wParam, (INT)sp_e->lParam);
2385 break;
2386 case SBM_GETRANGE:
2387 if ((enter && (sp_e->msgnum == SBM_GETRANGE)) ||
2388 (!enter && (sp_e->msgnum == SBM_SETRANGE))) break;
2390 LPINT ptmin = (LPINT) sp_e->wParam;
2391 LPINT ptmax = (LPINT) sp_e->lParam;
2392 if (ptmin && ptmax)
2393 TRACE("min=%d max=%d\n", *ptmin, *ptmax);
2394 else if (ptmin)
2395 TRACE("min=%d max=n/a\n", *ptmin);
2396 else if (ptmax)
2397 TRACE("min=n/a max=%d\n", *ptmax);
2398 break;
2400 case EM_EXSETSEL:
2401 if (enter && sp_e->lParam)
2403 CHARRANGE *cr = (CHARRANGE *) sp_e->lParam;
2404 TRACE("CHARRANGE: cpMin=%d cpMax=%d\n", cr->cpMin, cr->cpMax);
2406 break;
2407 case EM_SETCHARFORMAT:
2408 if (enter && sp_e->lParam)
2410 CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam;
2411 TRACE("CHARFORMAT: dwMask=0x%08x dwEffects=", cf->dwMask);
2412 if ((cf->dwMask & CFM_BOLD) && (cf->dwEffects & CFE_BOLD))
2413 TRACE(" CFE_BOLD");
2414 if ((cf->dwMask & CFM_COLOR) && (cf->dwEffects & CFE_AUTOCOLOR))
2415 TRACE(" CFE_AUTOCOLOR");
2416 if ((cf->dwMask & CFM_ITALIC) && (cf->dwEffects & CFE_ITALIC))
2417 TRACE(" CFE_ITALIC");
2418 if ((cf->dwMask & CFM_PROTECTED) && (cf->dwEffects & CFE_PROTECTED))
2419 TRACE(" CFE_PROTECTED");
2420 if ((cf->dwMask & CFM_STRIKEOUT) && (cf->dwEffects & CFE_STRIKEOUT))
2421 TRACE(" CFE_STRIKEOUT");
2422 if ((cf->dwMask & CFM_UNDERLINE) && (cf->dwEffects & CFE_UNDERLINE))
2423 TRACE(" CFE_UNDERLINE");
2424 TRACE("\n");
2425 if (cf->dwMask & CFM_SIZE)
2426 TRACE("yHeight=%d\n", cf->yHeight);
2427 if (cf->dwMask & CFM_OFFSET)
2428 TRACE("yOffset=%d\n", cf->yOffset);
2429 if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR))
2430 TRACE("crTextColor=%x\n", cf->crTextColor);
2431 TRACE("bCharSet=%x bPitchAndFamily=%x\n", cf->bCharSet, cf->bPitchAndFamily);
2432 /* FIXME: we should try to be a bit more intelligent about
2433 * whether this is in ANSI or Unicode (it could be either) */
2434 if (cf->dwMask & CFM_FACE)
2435 TRACE("szFaceName=%s\n", debugstr_wn(cf->szFaceName, LF_FACESIZE));
2436 /* FIXME: handle CHARFORMAT2 too */
2438 break;
2439 case WM_DRAWITEM:
2440 if (!enter) break;
2442 DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam;
2443 TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
2444 lpdis->CtlType, lpdis->CtlID);
2445 TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
2446 lpdis->itemID, lpdis->itemAction, lpdis->itemState);
2447 TRACE("hWnd=%p hDC=%p (%s) itemData=0x%08lx\n",
2448 lpdis->hwndItem, lpdis->hDC,
2449 wine_dbgstr_rect(&lpdis->rcItem), lpdis->itemData);
2451 break;
2452 case WM_MEASUREITEM:
2454 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam;
2455 TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
2456 lpmis->CtlType, lpmis->CtlID);
2457 TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n",
2458 lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight);
2459 TRACE("itemData=0x%08lx\n", lpmis->itemData);
2461 break;
2462 case WM_NCCREATE:
2463 case WM_CREATE:
2465 BOOL unicode;
2466 CREATESTRUCTA *cs;
2468 if (!enter) break;
2470 unicode = IsWindowUnicode(sp_e->msg_hwnd);
2471 cs = (CREATESTRUCTA *)sp_e->lParam;
2472 TRACE("%s %s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n",
2473 unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName),
2474 unicode ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass),
2475 cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
2476 cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams);
2477 break;
2479 case WM_SIZE:
2480 if (!enter) break;
2481 TRACE("cx=%d cy=%d\n", LOWORD(sp_e->lParam), HIWORD(sp_e->lParam));
2482 break;
2483 case WM_WINDOWPOSCHANGED:
2484 if (!enter) break;
2485 case WM_WINDOWPOSCHANGING:
2487 WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam;
2488 TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
2489 lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y,
2490 lpwp->cx, lpwp->cy, lpwp->flags);
2492 break;
2493 case WM_STYLECHANGED:
2494 if (!enter) break;
2495 case WM_STYLECHANGING:
2497 LPSTYLESTRUCT ss = (LPSTYLESTRUCT) sp_e->lParam;
2498 TRACE("STYLESTRUCT: StyleOld=0x%08x, StyleNew=0x%08x\n",
2499 ss->styleOld, ss->styleNew);
2501 break;
2502 case WM_NCCALCSIZE:
2503 if (!sp_e->wParam)
2505 RECT *rc = (RECT *)sp_e->lParam;
2506 TRACE("Rect %s\n", wine_dbgstr_rect(rc));
2508 else
2510 NCCALCSIZE_PARAMS *nc = (NCCALCSIZE_PARAMS *)sp_e->lParam;
2511 TRACE("Rects %s %s %s\n", wine_dbgstr_rect(nc->rgrc),
2512 wine_dbgstr_rect(nc->rgrc + 1), wine_dbgstr_rect(nc->rgrc + 2));
2513 if (nc->lppos)
2514 TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
2515 nc->lppos->hwnd, nc->lppos->hwndInsertAfter, nc->lppos->x, nc->lppos->y,
2516 nc->lppos->cx, nc->lppos->cy, nc->lppos->flags);
2518 break;
2519 case WM_NOTIFY:
2520 /* if (!enter) break; */
2522 NMHDR * pnmh = (NMHDR*) sp_e->lParam;
2523 UINT *q, dumplen;
2524 const SPY_NOTIFY *p;
2525 WCHAR from_class[60];
2526 DWORD save_error;
2528 p = SPY_Bsearch_Notify( pnmh->code );
2529 if (p) {
2530 TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=%s<0x%08x>, extra=0x%x\n",
2531 pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len);
2532 dumplen = p->len;
2534 /* for CUSTOMDRAW, dump all the data for TOOLBARs */
2535 if (pnmh->code == NM_CUSTOMDRAW) {
2536 /* save and restore error code over the next call */
2537 save_error = GetLastError();
2538 GetClassNameW(pnmh->hwndFrom, from_class, ARRAY_SIZE(from_class));
2539 SetLastError(save_error);
2540 if (wcscmp(TOOLBARCLASSNAMEW, from_class) == 0)
2541 dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR);
2542 } else if ( pnmh->code >= HDN_ENDDRAG
2543 && pnmh->code <= HDN_ITEMCHANGINGA ) {
2544 dumplen = sizeof(NMHEADERA)-sizeof(NMHDR);
2546 if (dumplen > 0) {
2547 q = (UINT *)(pnmh + 1);
2548 SPY_DumpMem ("NM extra", q, (INT)dumplen);
2551 else
2552 TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=0x%08x\n",
2553 pnmh->hwndFrom, pnmh->idFrom, pnmh->code);
2555 break;
2556 default:
2557 if (sp_e->data_len > 0)
2558 SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len);
2564 /***********************************************************************
2565 * spy_init
2567 static BOOL spy_init(void)
2569 int i;
2570 char buffer[1024];
2571 HKEY hkey;
2572 char *exclude;
2574 if (!TRACE_ON(message)) return FALSE;
2576 if (indent_tls_index == TLS_OUT_OF_INDEXES)
2578 DWORD index = TlsAlloc();
2579 if (InterlockedCompareExchange( &indent_tls_index, index, TLS_OUT_OF_INDEXES ) != TLS_OUT_OF_INDEXES)
2580 TlsFree( index );
2583 if (spy_exclude) return TRUE;
2584 exclude = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, SPY_MAX_MSGNUM + 2 );
2586 /* @@ Wine registry key: HKCU\Software\Wine\Debug */
2587 if(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Debug", &hkey))
2589 DWORD type, count = sizeof(buffer);
2591 buffer[0] = 0;
2592 if (!RegQueryValueExA(hkey, "SpyInclude", 0, &type, (LPBYTE) buffer, &count) &&
2593 strcmp( buffer, "INCLUDEALL" ))
2595 TRACE("Include=%s\n", buffer );
2596 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
2597 exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
2600 count = sizeof(buffer);
2601 buffer[0] = 0;
2602 if (!RegQueryValueExA(hkey, "SpyExclude", 0, &type, (LPBYTE) buffer, &count))
2604 TRACE("Exclude=%s\n", buffer );
2605 if (!strcmp( buffer, "EXCLUDEALL" ))
2606 for (i = 0; i <= SPY_MAX_MSGNUM; i++) exclude[i] = TRUE;
2607 else
2608 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
2609 exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i]));
2612 count = sizeof(buffer);
2613 if(!RegQueryValueExA(hkey, "SpyExcludeDWP", 0, &type, (LPBYTE) buffer, &count))
2614 exclude[SPY_MAX_MSGNUM + 1] = atoi(buffer);
2616 RegCloseKey(hkey);
2619 if (InterlockedCompareExchangePointer( (void **)&spy_exclude, exclude, NULL ))
2620 HeapFree( GetProcessHeap(), 0, exclude );
2622 return TRUE;
2626 /***********************************************************************
2627 * SPY_EnterMessage
2629 void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
2630 WPARAM wParam, LPARAM lParam )
2632 SPY_INSTANCE sp_e;
2633 int indent;
2634 DWORD save_error = GetLastError();
2636 if (!spy_init() || exclude_msg(msg)) return;
2638 sp_e.msgnum = msg;
2639 sp_e.msg_hwnd = hWnd;
2640 sp_e.lParam = lParam;
2641 sp_e.wParam = wParam;
2642 SPY_GetWndName(&sp_e);
2643 SPY_GetMsgStuff(&sp_e);
2644 indent = get_indent_level();
2646 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
2647 switch(iFlag)
2649 case SPY_DISPATCHMESSAGE:
2650 TRACE("%*s(%p) %-16s [%04x] %s dispatched wp=%08lx lp=%08lx\n",
2651 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2652 sp_e.msg_name, wParam, lParam);
2653 break;
2655 case SPY_SENDMESSAGE:
2657 char taskName[20];
2658 DWORD tid = GetWindowThreadProcessId( hWnd, NULL );
2660 if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
2661 else sprintf( taskName, "tid %04x", GetCurrentThreadId() );
2663 TRACE("%*s(%p) %-16s [%04x] %s sent from %s wp=%08lx lp=%08lx\n",
2664 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2665 sp_e.msg_name, taskName, wParam, lParam );
2666 SPY_DumpStructure(&sp_e, TRUE);
2668 break;
2670 case SPY_DEFWNDPROC:
2671 if (exclude_dwp()) return;
2672 TRACE("%*s(%p) DefWindowProc:[%04x] %s wp=%08lx lp=%08lx\n",
2673 indent, "", hWnd, msg, sp_e.msg_name, wParam, lParam );
2674 break;
2676 set_indent_level( indent + SPY_INDENT_UNIT );
2677 SetLastError( save_error );
2681 /***********************************************************************
2682 * SPY_ExitMessage
2684 void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
2685 WPARAM wParam, LPARAM lParam )
2687 SPY_INSTANCE sp_e;
2688 int indent;
2689 DWORD save_error = GetLastError();
2691 if (!TRACE_ON(message) || exclude_msg(msg) ||
2692 (exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
2693 return;
2695 sp_e.msgnum = msg;
2696 sp_e.msg_hwnd = hWnd;
2697 sp_e.lParam = lParam;
2698 sp_e.wParam = wParam;
2699 SPY_GetWndName(&sp_e);
2700 SPY_GetMsgStuff(&sp_e);
2702 if ((indent = get_indent_level()))
2704 indent -= SPY_INDENT_UNIT;
2705 set_indent_level( indent );
2708 switch(iFlag)
2710 case SPY_RESULT_DEFWND:
2711 TRACE(" %*s(%p) DefWindowProc: [%04x] %s returned %08lx\n",
2712 indent, "", hWnd, msg, sp_e.msg_name, lReturn );
2713 break;
2715 case SPY_RESULT_OK:
2716 TRACE(" %*s(%p) %-16s [%04x] %s returned %08lx\n",
2717 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2718 sp_e.msg_name, lReturn );
2719 SPY_DumpStructure(&sp_e, FALSE);
2720 break;
2722 SetLastError( save_error );