spy.c 90.1 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2
/*
 * Message spying routines
Alexandre Julliard's avatar
Alexandre Julliard committed
3 4
 *
 * Copyright 1994, Bob Amstadt
5
 *           1995, Alex Korobka
6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
Alexandre Julliard's avatar
Alexandre Julliard committed
20 21 22
 */

#include <stdlib.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
23
#include <string.h>
24
#include <stdarg.h>
25 26
#include <stdio.h>
#include "windef.h"
27
#include "winbase.h"
28
#include "wingdi.h"
29
#include "winreg.h"
30
#include "wine/unicode.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
31
#include "win.h"
32
#include "user_private.h"
33
#include "wine/debug.h"
34
#include "commctrl.h"
35
#include "commdlg.h"
36
#include "richedit.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
37

38
WINE_DEFAULT_DEBUG_CHANNEL(message);
39

Alexandre Julliard's avatar
Alexandre Julliard committed
40 41
#define SPY_MAX_MSGNUM   WM_USER
#define SPY_INDENT_UNIT  4  /* 4 spaces */
42
#define ARRAYSIZE(a) ((sizeof(a) / sizeof((a)[0])))
Alexandre Julliard's avatar
Alexandre Julliard committed
43

44 45
#define DEBUG_SPY 0

46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
static const char * const ClassLongOffsetNames[] =
{
    "GCLP_MENUNAME",      /*  -8 */
    "GCLP_HBRBACKGROUND", /* -10 */
    "GCLP_HCURSOR",       /* -12 */
    "GCLP_HICON",         /* -14 */
    "GCLP_HMODULE",       /* -16 */
    "GCL_CBWNDEXTRA",     /* -18 */
    "GCL_CBCLSEXTRA",     /* -20 */
    "?",
    "GCLP_WNDPROC",       /* -24 */
    "GCL_STYLE",          /* -26 */
    "?",
    "?",
    "GCW_ATOM",           /* -32 */
    "GCLP_HICONSM",       /* -34 */
};

Alexandre Julliard's avatar
Alexandre Julliard committed
64
static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
Alexandre Julliard's avatar
Alexandre Julliard committed
65
{
66
    "WM_NULL",                  /* 0x00 */
67 68
    "WM_CREATE",
    "WM_DESTROY",
Alexandre Julliard's avatar
Alexandre Julliard committed
69
    "WM_MOVE",
Alexandre Julliard's avatar
Alexandre Julliard committed
70
    "wm_sizewait",
Alexandre Julliard's avatar
Alexandre Julliard committed
71 72 73 74
    "WM_SIZE",
    "WM_ACTIVATE",
    "WM_SETFOCUS",
    "WM_KILLFOCUS",
Alexandre Julliard's avatar
Alexandre Julliard committed
75
    "WM_SETVISIBLE",
Alexandre Julliard's avatar
Alexandre Julliard committed
76 77 78 79 80 81
    "WM_ENABLE",
    "WM_SETREDRAW",
    "WM_SETTEXT",
    "WM_GETTEXT",
    "WM_GETTEXTLENGTH",
    "WM_PAINT",
82
    "WM_CLOSE",                 /* 0x10 */
Alexandre Julliard's avatar
Alexandre Julliard committed
83 84 85 86 87 88
    "WM_QUERYENDSESSION",
    "WM_QUIT",
    "WM_QUERYOPEN",
    "WM_ERASEBKGND",
    "WM_SYSCOLORCHANGE",
    "WM_ENDSESSION",
Alexandre Julliard's avatar
Alexandre Julliard committed
89
    "wm_systemerror",
Alexandre Julliard's avatar
Alexandre Julliard committed
90 91 92 93 94 95 96 97
    "WM_SHOWWINDOW",
    "WM_CTLCOLOR",
    "WM_WININICHANGE",
    "WM_DEVMODECHANGE",
    "WM_ACTIVATEAPP",
    "WM_FONTCHANGE",
    "WM_TIMECHANGE",
    "WM_CANCELMODE",
98
    "WM_SETCURSOR",             /* 0x20 */
Alexandre Julliard's avatar
Alexandre Julliard committed
99 100 101 102
    "WM_MOUSEACTIVATE",
    "WM_CHILDACTIVATE",
    "WM_QUEUESYNC",
    "WM_GETMINMAXINFO",
Alexandre Julliard's avatar
Alexandre Julliard committed
103 104
    "wm_unused3",
    "wm_painticon",
Alexandre Julliard's avatar
Alexandre Julliard committed
105 106
    "WM_ICONERASEBKGND",
    "WM_NEXTDLGCTL",
Alexandre Julliard's avatar
Alexandre Julliard committed
107
    "wm_alttabactive",
Alexandre Julliard's avatar
Alexandre Julliard committed
108 109 110 111 112 113
    "WM_SPOOLERSTATUS",
    "WM_DRAWITEM",
    "WM_MEASUREITEM",
    "WM_DELETEITEM",
    "WM_VKEYTOITEM",
    "WM_CHARTOITEM",
114
    "WM_SETFONT",               /* 0x30 */
Alexandre Julliard's avatar
Alexandre Julliard committed
115
    "WM_GETFONT",
116 117 118
    "WM_SETHOTKEY",
    "WM_GETHOTKEY",
    "wm_filesyschange",
Alexandre Julliard's avatar
Alexandre Julliard committed
119 120
    "wm_isactiveicon",
    "wm_queryparkicon",
Alexandre Julliard's avatar
Alexandre Julliard committed
121
    "WM_QUERYDRAGICON",
Alexandre Julliard's avatar
Alexandre Julliard committed
122
    "wm_querysavestate",
123
    "WM_COMPAREITEM",
Alexandre Julliard's avatar
Alexandre Julliard committed
124
    "wm_testing",
125
    NULL,
126 127
    NULL,
    "WM_GETOBJECT",             /* 0x3d */
Alexandre Julliard's avatar
Alexandre Julliard committed
128
    "wm_activateshellwindow",
Alexandre Julliard's avatar
Alexandre Julliard committed
129
    NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
130

131
    NULL,                       /* 0x40 */
132 133
    "wm_compacting", NULL, NULL,
    "WM_COMMNOTIFY", NULL,
134 135
    "WM_WINDOWPOSCHANGING",     /* 0x0046 */
    "WM_WINDOWPOSCHANGED",      /* 0x0047 */
136 137 138
    "WM_POWER", NULL,
    "WM_COPYDATA",
    "WM_CANCELJOURNAL", NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
139
    "WM_NOTIFY", NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
140

Alexandre Julliard's avatar
Alexandre Julliard committed
141 142
    /* 0x0050 */
    "WM_INPUTLANGCHANGEREQUEST",
143 144 145 146 147
    "WM_INPUTLANGCHANGE",
    "WM_TCARD",
    "WM_HELP",
    "WM_USERCHANGED",
    "WM_NOTIFYFORMAT", NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
148 149 150 151 152 153 154 155
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x0060 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x0070 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
156 157 158 159 160
    NULL, NULL, NULL,
    "WM_CONTEXTMENU",
    "WM_STYLECHANGING",
    "WM_STYLECHANGED",
    "WM_DISPLAYCHANGE",
Alexandre Julliard's avatar
Alexandre Julliard committed
161
    "WM_GETICON",
Alexandre Julliard's avatar
Alexandre Julliard committed
162

163 164 165 166 167 168 169 170
    "WM_SETICON",               /* 0x0080 */
    "WM_NCCREATE",              /* 0x0081 */
    "WM_NCDESTROY",             /* 0x0082 */
    "WM_NCCALCSIZE",            /* 0x0083 */
    "WM_NCHITTEST",             /* 0x0084 */
    "WM_NCPAINT",               /* 0x0085 */
    "WM_NCACTIVATE",            /* 0x0086 */
    "WM_GETDLGCODE",            /* 0x0087 */
171
    "WM_SYNCPAINT",
172
    "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
173 174 175 176 177 178

    /* 0x0090 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x00A0 */
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
    "WM_NCMOUSEMOVE",           /* 0x00a0 */
    "WM_NCLBUTTONDOWN",         /* 0x00a1 */
    "WM_NCLBUTTONUP",           /* 0x00a2 */
    "WM_NCLBUTTONDBLCLK",       /* 0x00a3 */
    "WM_NCRBUTTONDOWN",         /* 0x00a4 */
    "WM_NCRBUTTONUP",           /* 0x00a5 */
    "WM_NCRBUTTONDBLCLK",       /* 0x00a6 */
    "WM_NCMBUTTONDOWN",         /* 0x00a7 */
    "WM_NCMBUTTONUP",           /* 0x00a8 */
    "WM_NCMBUTTONDBLCLK",       /* 0x00a9 */
    NULL,                       /* 0x00aa */
    "WM_NCXBUTTONDOWN",         /* 0x00ab */
    "WM_NCXBUTTONUP",           /* 0x00ac */
    "WM_NCXBUTTONDBLCLK",       /* 0x00ad */
    NULL,                       /* 0x00ae */
    NULL,                       /* 0x00af */
Alexandre Julliard's avatar
Alexandre Julliard committed
195

Alexandre Julliard's avatar
Alexandre Julliard committed
196
    /* 0x00B0 - Win32 Edit controls */
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
    "EM_GETSEL",                /* 0x00b0 */
    "EM_SETSEL",                /* 0x00b1 */
    "EM_GETRECT",               /* 0x00b2 */
    "EM_SETRECT",               /* 0x00b3 */
    "EM_SETRECTNP",             /* 0x00b4 */
    "EM_SCROLL",                /* 0x00b5 */
    "EM_LINESCROLL",            /* 0x00b6 */
    "EM_SCROLLCARET",           /* 0x00b7 */
    "EM_GETMODIFY",             /* 0x00b8 */
    "EM_SETMODIFY",             /* 0x00b9 */
    "EM_GETLINECOUNT",          /* 0x00ba */
    "EM_LINEINDEX",             /* 0x00bb */
    "EM_SETHANDLE",             /* 0x00bc */
    "EM_GETHANDLE",             /* 0x00bd */
    "EM_GETTHUMB",              /* 0x00be */
Alexandre Julliard's avatar
Alexandre Julliard committed
212
    NULL,                       /* 0x00bf */
Alexandre Julliard's avatar
Alexandre Julliard committed
213

Alexandre Julliard's avatar
Alexandre Julliard committed
214
    NULL,                       /* 0x00c0 */
215 216
    "EM_LINELENGTH",            /* 0x00c1 */
    "EM_REPLACESEL",            /* 0x00c2 */
Alexandre Julliard's avatar
Alexandre Julliard committed
217
    NULL,                       /* 0x00c3 */
218 219 220 221 222 223
    "EM_GETLINE",               /* 0x00c4 */
    "EM_LIMITTEXT",             /* 0x00c5 */
    "EM_CANUNDO",               /* 0x00c6 */
    "EM_UNDO",                  /* 0x00c7 */
    "EM_FMTLINES",              /* 0x00c8 */
    "EM_LINEFROMCHAR",          /* 0x00c9 */
Alexandre Julliard's avatar
Alexandre Julliard committed
224
    NULL,                       /* 0x00ca */
225 226 227 228 229
    "EM_SETTABSTOPS",           /* 0x00cb */
    "EM_SETPASSWORDCHAR",       /* 0x00cc */
    "EM_EMPTYUNDOBUFFER",       /* 0x00cd */
    "EM_GETFIRSTVISIBLELINE",   /* 0x00ce */
    "EM_SETREADONLY",           /* 0x00cf */
Alexandre Julliard's avatar
Alexandre Julliard committed
230

231 232 233 234 235 236 237 238
    "EM_SETWORDBREAKPROC",      /* 0x00d0 */
    "EM_GETWORDBREAKPROC",      /* 0x00d1 */
    "EM_GETPASSWORDCHAR",       /* 0x00d2 */
    "EM_SETMARGINS",            /* 0x00d3 */
    "EM_GETMARGINS",            /* 0x00d4 */
    "EM_GETLIMITTEXT",          /* 0x00d5 */
    "EM_POSFROMCHAR",           /* 0x00d6 */
    "EM_CHARFROMPOS",           /* 0x00d7 */
239 240 241
    "EM_SETIMESTATUS",          /* 0x00d8 */
    "EM_GETIMESTATUS",          /* 0x00d9 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
242

Alexandre Julliard's avatar
Alexandre Julliard committed
243
    /* 0x00E0 - Win32 Scrollbars */
244 245 246 247 248
    "SBM_SETPOS",               /* 0x00e0 */
    "SBM_GETPOS",               /* 0x00e1 */
    "SBM_SETRANGE",             /* 0x00e2 */
    "SBM_GETRANGE",             /* 0x00e3 */
    "SBM_ENABLE_ARROWS",        /* 0x00e4 */
Alexandre Julliard's avatar
Alexandre Julliard committed
249
    NULL,
250
    "SBM_SETRANGEREDRAW",       /* 0x00e6 */
Alexandre Julliard's avatar
Alexandre Julliard committed
251
    NULL, NULL,
252 253
    "SBM_SETSCROLLINFO",        /* 0x00e9 */
    "SBM_GETSCROLLINFO",        /* 0x00ea */
Alexandre Julliard's avatar
Alexandre Julliard committed
254
    NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
255

Alexandre Julliard's avatar
Alexandre Julliard committed
256
    /* 0x00F0 - Win32 Buttons */
257 258 259 260 261 262 263 264
    "BM_GETCHECK",              /* 0x00f0 */
    "BM_SETCHECK",              /* 0x00f1 */
    "BM_GETSTATE",              /* 0x00f2 */
    "BM_SETSTATE",              /* 0x00f3 */
    "BM_SETSTYLE",              /* 0x00f4 */
    "BM_CLICK",                 /* 0x00f5 */
    "BM_GETIMAGE",              /* 0x00f6 */
    "BM_SETIMAGE",              /* 0x00f7 */
265 266 267
    NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_INPUT_DEVICE_CHANGE",   /* 0x00fe */
    "WM_INPUT",                 /* 0x00ff */
Alexandre Julliard's avatar
Alexandre Julliard committed
268

269 270 271 272 273 274 275 276
    "WM_KEYDOWN",               /* 0x0100 */
    "WM_KEYUP",                 /* 0x0101 */
    "WM_CHAR",                  /* 0x0102 */
    "WM_DEADCHAR",              /* 0x0103 */
    "WM_SYSKEYDOWN",            /* 0x0104 */
    "WM_SYSKEYUP",              /* 0x0105 */
    "WM_SYSCHAR",               /* 0x0106 */
    "WM_SYSDEADCHAR",           /* 0x0107 */
277
    NULL,
278 279 280 281
    "WM_UNICHAR",               /* 0x0109 */
    "WM_CONVERTREQUEST",        /* 0x010a */
    "WM_CONVERTRESULT",         /* 0x010b */
    "WM_INTERIM",               /* 0x010c */
282 283 284 285 286 287 288 289 290 291
    "WM_IME_STARTCOMPOSITION",  /* 0x010d */
    "WM_IME_ENDCOMPOSITION",    /* 0x010e */
    "WM_IME_COMPOSITION",       /* 0x010f */

    "WM_INITDIALOG",            /* 0x0110 */
    "WM_COMMAND",               /* 0x0111 */
    "WM_SYSCOMMAND",            /* 0x0112 */
    "WM_TIMER",                 /* 0x0113 */
    "WM_HSCROLL",               /* 0x0114 */
    "WM_VSCROLL",               /* 0x0115 */
Alexandre Julliard's avatar
Alexandre Julliard committed
292 293
    "WM_INITMENU",              /* 0x0116 */
    "WM_INITMENUPOPUP",         /* 0x0117 */
294
    "WM_SYSTIMER",              /* 0x0118 */
Alexandre Julliard's avatar
Alexandre Julliard committed
295 296
    NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_MENUSELECT",            /* 0x011f */
Alexandre Julliard's avatar
Alexandre Julliard committed
297

Alexandre Julliard's avatar
Alexandre Julliard committed
298 299
    "WM_MENUCHAR",              /* 0x0120 */
    "WM_ENTERIDLE",             /* 0x0121 */
300 301 302 303 304 305 306 307 308 309

    "WM_MENURBUTTONUP",         /* 0x0122 */
    "WM_MENUDRAG",              /* 0x0123 */
    "WM_MENUGETOBJECT",         /* 0x0124 */
    "WM_UNINITMENUPOPUP",       /* 0x0125 */
    "WM_MENUCOMMAND",           /* 0x0126 */
    "WM_CHANGEUISTATE",         /* 0x0127 */
    "WM_UPDATEUISTATE",         /* 0x0128 */
    "WM_QUERYUISTATE",          /* 0x0129 */

Alexandre Julliard's avatar
Alexandre Julliard committed
310
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
311 312

    /* 0x0130 */
Alexandre Julliard's avatar
Alexandre Julliard committed
313
    NULL,
314
    "WM_LBTRACKPOINT",          /* 0x0131 */
Alexandre Julliard's avatar
Alexandre Julliard committed
315 316 317 318 319 320 321 322
    "WM_CTLCOLORMSGBOX",        /* 0x0132 */
    "WM_CTLCOLOREDIT",          /* 0x0133 */
    "WM_CTLCOLORLISTBOX",       /* 0x0134 */
    "WM_CTLCOLORBTN",           /* 0x0135 */
    "WM_CTLCOLORDLG",           /* 0x0136 */
    "WM_CTLCOLORSCROLLBAR",     /* 0x0137 */
    "WM_CTLCOLORSTATIC",        /* 0x0138 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
323

Alexandre Julliard's avatar
Alexandre Julliard committed
324
    /* 0x0140 - Win32 Comboboxes */
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
    "CB_GETEDITSEL",            /* 0x0140 */
    "CB_LIMITTEXT",             /* 0x0141 */
    "CB_SETEDITSEL",            /* 0x0142 */
    "CB_ADDSTRING",             /* 0x0143 */
    "CB_DELETESTRING",          /* 0x0144 */
    "CB_DIR",                   /* 0x0145 */
    "CB_GETCOUNT",              /* 0x0146 */
    "CB_GETCURSEL",             /* 0x0147 */
    "CB_GETLBTEXT",             /* 0x0148 */
    "CB_GETLBTEXTLEN",          /* 0x0149 */
    "CB_INSERTSTRING",          /* 0x014a */
    "CB_RESETCONTENT",          /* 0x014b */
    "CB_FINDSTRING",            /* 0x014c */
    "CB_SELECTSTRING",          /* 0x014d */
    "CB_SETCURSEL",             /* 0x014e */
    "CB_SHOWDROPDOWN",          /* 0x014f */
Alexandre Julliard's avatar
Alexandre Julliard committed
341

342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
    "CB_GETITEMDATA",           /* 0x0150 */
    "CB_SETITEMDATA",           /* 0x0151 */
    "CB_GETDROPPEDCONTROLRECT", /* 0x0152 */
    "CB_SETITEMHEIGHT",         /* 0x0153 */
    "CB_GETITEMHEIGHT",         /* 0x0154 */
    "CB_SETEXTENDEDUI",         /* 0x0155 */
    "CB_GETEXTENDEDUI",         /* 0x0156 */
    "CB_GETDROPPEDSTATE",       /* 0x0157 */
    "CB_FINDSTRINGEXACT",       /* 0x0158 */
    "CB_SETLOCALE",             /* 0x0159 */
    "CB_GETLOCALE",             /* 0x015a */
    "CB_GETTOPINDEX",           /* 0x015b */
    "CB_SETTOPINDEX",           /* 0x015c */
    "CB_GETHORIZONTALEXTENT",   /* 0x015d */
    "CB_SETHORIZONTALEXTENT",   /* 0x015e */
    "CB_GETDROPPEDWIDTH",       /* 0x015f */
Alexandre Julliard's avatar
Alexandre Julliard committed
358

359 360
    "CB_SETDROPPEDWIDTH",       /* 0x0160 */
    "CB_INITSTORAGE",           /* 0x0161 */
Alexandre Julliard's avatar
Alexandre Julliard committed
361
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
362 363
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

Alexandre Julliard's avatar
Alexandre Julliard committed
364
    /* 0x0170 - Win32 Static controls */
365 366 367 368 369
    "STM_SETICON",              /* 0x0170 */
    "STM_GETICON",              /* 0x0171 */
    "STM_SETIMAGE",             /* 0x0172 */
    "STM_GETIMAGE",             /* 0x0173 */
    NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
370 371
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

Alexandre Julliard's avatar
Alexandre Julliard committed
372
    /* 0x0180 - Win32 Listboxes */
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
    "LB_ADDSTRING",             /* 0x0180 */
    "LB_INSERTSTRING",          /* 0x0181 */
    "LB_DELETESTRING",          /* 0x0182 */
    "LB_SELITEMRANGEEX",        /* 0x0183 */
    "LB_RESETCONTENT",          /* 0x0184 */
    "LB_SETSEL",                /* 0x0185 */
    "LB_SETCURSEL",             /* 0x0186 */
    "LB_GETSEL",                /* 0x0187 */
    "LB_GETCURSEL",             /* 0x0188 */
    "LB_GETTEXT",               /* 0x0189 */
    "LB_GETTEXTLEN",            /* 0x018a */
    "LB_GETCOUNT",              /* 0x018b */
    "LB_SELECTSTRING",          /* 0x018c */
    "LB_DIR",                   /* 0x018d */
    "LB_GETTOPINDEX",           /* 0x018e */
    "LB_FINDSTRING",            /* 0x018f */
Alexandre Julliard's avatar
Alexandre Julliard committed
389

390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
    "LB_GETSELCOUNT",           /* 0x0190 */
    "LB_GETSELITEMS",           /* 0x0191 */
    "LB_SETTABSTOPS",           /* 0x0192 */
    "LB_GETHORIZONTALEXTENT",   /* 0x0193 */
    "LB_SETHORIZONTALEXTENT",   /* 0x0194 */
    "LB_SETCOLUMNWIDTH",        /* 0x0195 */
    "LB_ADDFILE",               /* 0x0196 */
    "LB_SETTOPINDEX",           /* 0x0197 */
    "LB_GETITEMRECT",           /* 0x0198 */
    "LB_GETITEMDATA",           /* 0x0199 */
    "LB_SETITEMDATA",           /* 0x019a */
    "LB_SELITEMRANGE",          /* 0x019b */
    "LB_SETANCHORINDEX",        /* 0x019c */
    "LB_GETANCHORINDEX",        /* 0x019d */
    "LB_SETCARETINDEX",         /* 0x019e */
    "LB_GETCARETINDEX",         /* 0x019f */
Alexandre Julliard's avatar
Alexandre Julliard committed
406

407 408 409 410 411 412 413 414 415 416
    "LB_SETITEMHEIGHT",         /* 0x01a0 */
    "LB_GETITEMHEIGHT",         /* 0x01a1 */
    "LB_FINDSTRINGEXACT",       /* 0x01a2 */
    "LB_CARETON",               /* 0x01a3 */
    "LB_CARETOFF",              /* 0x01a4 */
    "LB_SETLOCALE",             /* 0x01a5 */
    "LB_GETLOCALE",             /* 0x01a6 */
    "LB_SETCOUNT",              /* 0x01a7 */
    "LB_INITSTORAGE",           /* 0x01a8 */
    "LB_ITEMFROMPOINT",         /* 0x01a9 */
Alexandre Julliard's avatar
Alexandre Julliard committed
417
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
418 419

    /* 0x01B0 */
420 421 422
    NULL, NULL,
    "LB_GETLISTBOXINFO",         /* 0x01b2 */
    NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
423 424 425 426 427 428 429 430 431 432 433
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x01C0 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x01D0 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x01E0 */
434 435 436
    NULL,
    "MN_GETHMENU",              /* 0x01E1 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
437 438 439 440 441 442
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x01F0 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

443 444 445 446 447 448 449 450 451 452
    "WM_MOUSEMOVE",             /* 0x0200 */
    "WM_LBUTTONDOWN",           /* 0x0201 */
    "WM_LBUTTONUP",             /* 0x0202 */
    "WM_LBUTTONDBLCLK",         /* 0x0203 */
    "WM_RBUTTONDOWN",           /* 0x0204 */
    "WM_RBUTTONUP",             /* 0x0205 */
    "WM_RBUTTONDBLCLK",         /* 0x0206 */
    "WM_MBUTTONDOWN",           /* 0x0207 */
    "WM_MBUTTONUP",             /* 0x0208 */
    "WM_MBUTTONDBLCLK",         /* 0x0209 */
453
    "WM_MOUSEWHEEL",            /* 0x020A */
454 455 456
    "WM_XBUTTONDOWN",           /* 0x020B */
    "WM_XBUTTONUP",             /* 0x020C */
    "WM_XBUTTONDBLCLK",         /* 0x020D */
457 458
    "WM_MOUSEHWHEEL",           /* 0x020E */
    NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
459

460
    "WM_PARENTNOTIFY",          /* 0x0210 */
Alexandre Julliard's avatar
Alexandre Julliard committed
461 462
    "WM_ENTERMENULOOP",         /* 0x0211 */
    "WM_EXITMENULOOP",          /* 0x0212 */
463
    "WM_NEXTMENU",              /* 0x0213 */
464
    "WM_SIZING",
Alexandre Julliard's avatar
Alexandre Julliard committed
465 466
    "WM_CAPTURECHANGED",
    "WM_MOVING", NULL,
467
    "WM_POWERBROADCAST",
Alexandre Julliard's avatar
Alexandre Julliard committed
468
    "WM_DEVICECHANGE", NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
469 470 471 472 473 474 475 476 477 478 479 480

    "WM_MDICREATE",             /* 0x0220 */
    "WM_MDIDESTROY",            /* 0x0221 */
    "WM_MDIACTIVATE",           /* 0x0222 */
    "WM_MDIRESTORE",            /* 0x0223 */
    "WM_MDINEXT",               /* 0x0224 */
    "WM_MDIMAXIMIZE",           /* 0x0225 */
    "WM_MDITILE",               /* 0x0226 */
    "WM_MDICASCADE",            /* 0x0227 */
    "WM_MDIICONARRANGE",        /* 0x0228 */
    "WM_MDIGETACTIVE",          /* 0x0229 */

481 482
    "WM_DROPOBJECT",
    "WM_QUERYDROPOBJECT",
483 484 485 486
    "WM_BEGINDRAG",
    "WM_DRAGLOOP",
    "WM_DRAGSELECT",
    "WM_DRAGMOVE",
487

Alexandre Julliard's avatar
Alexandre Julliard committed
488
    /* 0x0230*/
Alexandre Julliard's avatar
Alexandre Julliard committed
489
    "WM_MDISETMENU",            /* 0x0230 */
490 491 492
    "WM_ENTERSIZEMOVE",         /* 0x0231 */
    "WM_EXITSIZEMOVE",          /* 0x0232 */
    "WM_DROPFILES",             /* 0x0233 */
493
    "WM_MDIREFRESHMENU", NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
494 495
    /* 0x0238*/
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
496

Alexandre Julliard's avatar
Alexandre Julliard committed
497 498 499 500 501 502 503
    /* 0x0240 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x0250 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
504

Alexandre Julliard's avatar
Alexandre Julliard committed
505 506 507 508 509 510 511
    /* 0x0260 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x0280 */
512 513 514 515 516 517 518 519 520 521 522 523 524
    NULL,
    "WM_IME_SETCONTEXT",        /* 0x0281 */
    "WM_IME_NOTIFY",            /* 0x0282 */
    "WM_IME_CONTROL",           /* 0x0283 */
    "WM_IME_COMPOSITIONFULL",   /* 0x0284 */
    "WM_IME_SELECT",            /* 0x0285 */
    "WM_IME_CHAR",              /* 0x0286 */
    NULL,
    "WM_IME_REQUEST",           /* 0x0288 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_IME_KEYDOWN",           /* 0x0290 */
    "WM_IME_KEYUP",             /* 0x0291 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
525 526
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

527
    /* 0x02a0 */
528 529 530 531 532 533 534
    "WM_NCMOUSEHOVER",          /* 0x02A0 */
    "WM_MOUSEHOVER",            /* 0x02A1 */
    "WM_NCMOUSELEAVE",          /* 0x02A2 */
    "WM_MOUSELEAVE",            /* 0x02A3 */
    NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_WTSSESSION_CHANGE",     /* 0x02B1 */
Alexandre Julliard's avatar
Alexandre Julliard committed
535
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
536
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
537 538

    /* 0x02c0 */
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570
    "WM_TABLET_FIRST",          /* 0x02c0 */
    "WM_TABLET_FIRST+1",        /* 0x02c1 */
    "WM_TABLET_FIRST+2",        /* 0x02c2 */
    "WM_TABLET_FIRST+3",        /* 0x02c3 */
    "WM_TABLET_FIRST+4",        /* 0x02c4 */
    "WM_TABLET_FIRST+5",        /* 0x02c5 */
    "WM_TABLET_FIRST+7",        /* 0x02c6 */
    "WM_TABLET_FIRST+8",        /* 0x02c7 */
    "WM_TABLET_FIRST+9",        /* 0x02c8 */
    "WM_TABLET_FIRST+10",       /* 0x02c9 */
    "WM_TABLET_FIRST+11",       /* 0x02ca */
    "WM_TABLET_FIRST+12",       /* 0x02cb */
    "WM_TABLET_FIRST+13",       /* 0x02cc */
    "WM_TABLET_FIRST+14",       /* 0x02cd */
    "WM_TABLET_FIRST+15",       /* 0x02ce */
    "WM_TABLET_FIRST+16",       /* 0x02cf */
    "WM_TABLET_FIRST+17",       /* 0x02d0 */
    "WM_TABLET_FIRST+18",       /* 0x02d1 */
    "WM_TABLET_FIRST+19",       /* 0x02d2 */
    "WM_TABLET_FIRST+20",       /* 0x02d3 */
    "WM_TABLET_FIRST+21",       /* 0x02d4 */
    "WM_TABLET_FIRST+22",       /* 0x02d5 */
    "WM_TABLET_FIRST+23",       /* 0x02d6 */
    "WM_TABLET_FIRST+24",       /* 0x02d7 */
    "WM_TABLET_FIRST+25",       /* 0x02d8 */
    "WM_TABLET_FIRST+26",       /* 0x02d9 */
    "WM_TABLET_FIRST+27",       /* 0x02da */
    "WM_TABLET_FIRST+28",       /* 0x02db */
    "WM_TABLET_FIRST+29",       /* 0x02dc */
    "WM_TABLET_FIRST+30",       /* 0x02dd */
    "WM_TABLET_FIRST+31",       /* 0x02de */
    "WM_TABLET_LAST",           /* 0x02df */
Alexandre Julliard's avatar
Alexandre Julliard committed
571 572 573 574 575 576

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

577
    "WM_CUT",                   /* 0x0300 */
578 579 580 581 582 583
    "WM_COPY",
    "WM_PASTE",
    "WM_CLEAR",
    "WM_UNDO",
    "WM_RENDERFORMAT",
    "WM_RENDERALLFORMATS",
Alexandre Julliard's avatar
Alexandre Julliard committed
584
    "WM_DESTROYCLIPBOARD",
585 586 587 588 589
    "WM_DRAWCLIPBOARD",
    "WM_PAINTCLIPBOARD",
    "WM_VSCROLLCLIPBOARD",
    "WM_SIZECLIPBOARD",
    "WM_ASKCBFORMATNAME",
Alexandre Julliard's avatar
Alexandre Julliard committed
590 591
    "WM_CHANGECBCHAIN",
    "WM_HSCROLLCLIPBOARD",
592
    "WM_QUERYNEWPALETTE",       /* 0x030f*/
Alexandre Julliard's avatar
Alexandre Julliard committed
593 594

    "WM_PALETTEISCHANGING",
Alexandre Julliard's avatar
Alexandre Julliard committed
595
    "WM_PALETTECHANGED",
596
    "WM_HOTKEY",                /* 0x0312 */
597 598
    "WM_POPUPSYSTEMMENU",       /* 0x0313 */
    NULL, NULL, NULL,
599 600 601 602
    "WM_PRINT",                 /* 0x0317 */
    "WM_PRINTCLIENT",           /* 0x0318 */
    "WM_APPCOMMAND",            /* 0x0319 */
    "WM_THEMECHANGED",          /* 0x031A */
603 604 605 606
    NULL, NULL,
    "WM_CLIPBOARDUPDATE",       /* 0x031D */
    "WM_DWMCOMPOSITIONCHANGED", /* 0x031E */
    "WM_DWMNCRENDERINGCHANGED", /* 0x031F */
Alexandre Julliard's avatar
Alexandre Julliard committed
607

608 609 610
    "WM_DWMCOLORIZATIONCOLORCHANGED", /* 0x0320 */
    "WM_DWMWINDOWMAXIMIZEDCHANGE", /* 0x0321 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
611
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
612

Alexandre Julliard's avatar
Alexandre Julliard committed
613
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
614 615
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_GETTITLEBARINFOEX",     /* 0x033F */
Alexandre Julliard's avatar
Alexandre Julliard committed
616 617 618 619

    /* 0x0340 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
620
    /* 0x0350 */
Alexandre Julliard's avatar
Alexandre Julliard committed
621
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
622 623 624 625 626 627 628 629
    "WM_HANDHELDFIRST",     /* 0x0358 */
    "WM_HANDHELDFIRST+1",   /* 0x0359 */
    "WM_HANDHELDFIRST+2",   /* 0x035A */
    "WM_HANDHELDFIRST+3",   /* 0x035B */
    "WM_HANDHELDFIRST+4",   /* 0x035C */
    "WM_HANDHELDFIRST+5",   /* 0x035D */
    "WM_HANDHELDFIRST+6",   /* 0x035E */
    "WM_HANDHELDLAST",      /* 0x035F */
Alexandre Julliard's avatar
Alexandre Julliard committed
630

631
    "WM_QUERYAFXWNDPROC",   /*  0x0360 WM_AFXFIRST */
Alexandre Julliard's avatar
Alexandre Julliard committed
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657
    "WM_SIZEPARENT",        /*  0x0361 */
    "WM_SETMESSAGESTRING",  /*  0x0362 */
    "WM_IDLEUPDATECMDUI",   /*  0x0363 */
    "WM_INITIALUPDATE",     /*  0x0364 */
    "WM_COMMANDHELP",       /*  0x0365 */
    "WM_HELPHITTEST",       /*  0x0366 */
    "WM_EXITHELPMODE",      /*  0x0367 */
    "WM_RECALCPARENT",      /*  0x0368 */
    "WM_SIZECHILD",         /*  0x0369 */
    "WM_KICKIDLE",          /*  0x036A */
    "WM_QUERYCENTERWND",    /*  0x036B */
    "WM_DISABLEMODAL",      /*  0x036C */
    "WM_FLOATSTATUS",       /*  0x036D */
    "WM_ACTIVATETOPLEVEL",  /*  0x036E */
    "WM_QUERY3DCONTROLS",   /*  0x036F */
    NULL,NULL,NULL,
    "WM_SOCKET_NOTIFY",     /*  0x0373 */
    "WM_SOCKET_DEAD",       /*  0x0374 */
    "WM_POPMESSAGESTRING",  /*  0x0375 */
    "WM_OCC_LOADFROMSTREAM",     /* 0x0376 */
    "WM_OCC_LOADFROMSTORAGE",    /* 0x0377 */
    "WM_OCC_INITNEW",            /* 0x0378 */
    "WM_QUEUE_SENTINEL",         /* 0x0379 */
    "WM_OCC_LOADFROMSTREAM_EX",  /* 0x037A */
    "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */

658 659
    NULL,NULL,NULL,
    "WM_AFXLAST",               /* 0x037F */
Alexandre Julliard's avatar
Alexandre Julliard committed
660

661 662 663 664 665 666 667 668 669 670 671 672 673 674
    "WM_PENWINFIRST",           /* 0x0380 */
    "WM_RCRESULT",              /* 0x0381 */
    "WM_HOOKRCRESULT",          /* 0x0382 */
    "WM_GLOBALRCCHANGE",        /* 0x0383 */
    "WM_SKB",                   /* 0x0384 */
    "WM_HEDITCTL",              /* 0x0385 */
    NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_PENWINLAST",            /* 0x038F */

    "WM_COALESCE_FIRST",        /* 0x0390 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_COALESCE_LAST",         /* 0x039F */
675

Alexandre Julliard's avatar
Alexandre Julliard committed
676
    /* 0x03a0 */
677 678 679 680
    "MM_JOY1MOVE",
    "MM_JOY2MOVE",
    "MM_JOY1ZMOVE",
    "MM_JOY2ZMOVE",
Alexandre Julliard's avatar
Alexandre Julliard committed
681 682 683 684
                            NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x03b0 */
685 686 687
    NULL, NULL, NULL, NULL, NULL,
    "MM_JOY1BUTTONDOWN",
    "MM_JOY2BUTTONDOWN",
Alexandre Julliard's avatar
Alexandre Julliard committed
688 689
    "MM_JOY1BUTTONUP",
    "MM_JOY2BUTTONUP",
690
    "MM_MCINOTIFY",       /* 0x03B9 */
691
                NULL,
692 693 694 695 696
    "MM_WOM_OPEN",        /* 0x03BB */
    "MM_WOM_CLOSE",       /* 0x03BC */
    "MM_WOM_DONE",        /* 0x03BD */
    "MM_WIM_OPEN",        /* 0x03BE */
    "MM_WIM_CLOSE",       /* 0x03BF */
Alexandre Julliard's avatar
Alexandre Julliard committed
697 698

    /* 0x03c0 */
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
    "MM_WIM_DATA",        /* 0x03C0 */
    "MM_MIM_OPEN",        /* 0x03C1 */
    "MM_MIM_CLOSE",       /* 0x03C2 */
    "MM_MIM_DATA",        /* 0x03C3 */
    "MM_MIM_LONGDATA",    /* 0x03C4 */
    "MM_MIM_ERROR",       /* 0x03C5 */
    "MM_MIM_LONGERROR",   /* 0x03C6 */
    "MM_MOM_OPEN",        /* 0x03C7 */
    "MM_MOM_CLOSE",       /* 0x03C8 */
    "MM_MOM_DONE",        /* 0x03C9 */
    "MM_MOM_POSITIONCB",  /* 0x03CA */
    "MM_MCISIGNAL",       /* 0x03CB */
    "MM_MIM_MOREDATA",    /* 0x03CC */
                                  NULL, NULL, NULL,

    /* 0x03d0 */
    "MM_MIXM_LINE_CHANGE",
    "MM_MIXM_CONTROL_CHANGE",
Alexandre Julliard's avatar
Alexandre Julliard committed
717
                NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
718 719 720 721
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x03e0 */
    "WM_DDE_INITIATE",  /* 0x3E0 */
722 723 724 725 726 727 728 729
    "WM_DDE_TERMINATE", /* 0x3E1 */
    "WM_DDE_ADVISE",    /* 0x3E2 */
    "WM_DDE_UNADVISE",  /* 0x3E3 */
    "WM_DDE_ACK",       /* 0x3E4 */
    "WM_DDE_DATA",      /* 0x3E5 */
    "WM_DDE_REQUEST",   /* 0x3E6 */
    "WM_DDE_POKE",      /* 0x3E7 */
    "WM_DDE_EXECUTE",   /* 0x3E8 */
Alexandre Julliard's avatar
Alexandre Julliard committed
730 731
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,

732

Alexandre Julliard's avatar
Alexandre Julliard committed
733 734 735 736
    /* 0x03f0 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

737
    "WM_USER"                   /* 0x0400 */
Alexandre Julliard's avatar
Alexandre Julliard committed
738 739
};

Alexandre Julliard's avatar
Alexandre Julliard committed
740

741
#define SPY_MAX_LVMMSGNUM   182
742 743
static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] =
{
744
    "LVM_GETBKCOLOR",           /* 1000 */
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
    "LVM_SETBKCOLOR",
    "LVM_GETIMAGELIST",
    "LVM_SETIMAGELIST",
    "LVM_GETITEMCOUNT",
    "LVM_GETITEMA",
    "LVM_SETITEMA",
    "LVM_INSERTITEMA",
    "LVM_DELETEITEM",
    "LVM_DELETEALLITEMS",
    "LVM_GETCALLBACKMASK",
    "LVM_SETCALLBACKMASK",
    "LVM_GETNEXTITEM",
    "LVM_FINDITEMA",
    "LVM_GETITEMRECT",
    "LVM_SETITEMPOSITION",
    "LVM_GETITEMPOSITION",
    "LVM_GETSTRINGWIDTHA",
    "LVM_HITTEST",
    "LVM_ENSUREVISIBLE",
    "LVM_SCROLL",
    "LVM_REDRAWITEMS",
    "LVM_ARRANGE",
    "LVM_EDITLABELA",
    "LVM_GETEDITCONTROL",
    "LVM_GETCOLUMNA",
    "LVM_SETCOLUMNA",
    "LVM_INSERTCOLUMNA",
    "LVM_DELETECOLUMN",
    "LVM_GETCOLUMNWIDTH",
    "LVM_SETCOLUMNWIDTH",
    "LVM_GETHEADER",
776
    NULL,
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
    "LVM_CREATEDRAGIMAGE",
    "LVM_GETVIEWRECT",
    "LVM_GETTEXTCOLOR",
    "LVM_SETTEXTCOLOR",
    "LVM_GETTEXTBKCOLOR",
    "LVM_SETTEXTBKCOLOR",
    "LVM_GETTOPINDEX",
    "LVM_GETCOUNTPERPAGE",
    "LVM_GETORIGIN",
    "LVM_UPDATE",
    "LVM_SETITEMSTATE",
    "LVM_GETITEMSTATE",
    "LVM_GETITEMTEXTA",
    "LVM_SETITEMTEXTA",
    "LVM_SETITEMCOUNT",
    "LVM_SORTITEMS",
    "LVM_SETITEMPOSITION32",
    "LVM_GETSELECTEDCOUNT",
    "LVM_GETITEMSPACING",
    "LVM_GETISEARCHSTRINGA",
    "LVM_SETICONSPACING",
    "LVM_SETEXTENDEDLISTVIEWSTYLE",
    "LVM_GETEXTENDEDLISTVIEWSTYLE",
    "LVM_GETSUBITEMRECT",
    "LVM_SUBITEMHITTEST",
    "LVM_SETCOLUMNORDERARRAY",
    "LVM_GETCOLUMNORDERARRAY",
    "LVM_SETHOTITEM",
    "LVM_GETHOTITEM",
    "LVM_SETHOTCURSOR",
    "LVM_GETHOTCURSOR",
    "LVM_APPROXIMATEVIEWRECT",
    "LVM_SETWORKAREAS",
    "LVM_GETSELECTIONMARK",
    "LVM_SETSELECTIONMARK",
    "LVM_SETBKIMAGEA",
    "LVM_GETBKIMAGEA",
    "LVM_GETWORKAREAS",
    "LVM_SETHOVERTIME",
    "LVM_GETHOVERTIME",
    "LVM_GETNUMBEROFWORKAREAS",
    "LVM_SETTOOLTIPS",
    "LVM_GETITEMW",
    "LVM_SETITEMW",
    "LVM_INSERTITEMW",
    "LVM_GETTOOLTIPS",
    NULL,
    NULL,
    NULL,
    NULL,
    "LVM_FINDITEMW",
    NULL,
    NULL,
    NULL,
    "LVM_GETSTRINGWIDTHW",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "LVM_GETCOLUMNW",
    "LVM_SETCOLUMNW",
    "LVM_INSERTCOLUMNW",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "LVM_GETITEMTEXTW",
    "LVM_SETITEMTEXTW",
    "LVM_GETISEARCHSTRINGW",
    "LVM_EDITLABELW",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "LVM_SETBKIMAGEW",
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
    "LVM_GETBKIMAGEW",   /* 0x108B */
    "LVM_SETSELECTEDCOLUMN",
    "LVM_SETTILEWIDTH",
    "LVM_SETVIEW",
    "LVM_GETVIEW",
    NULL,
    "LVM_INSERTGROUP",
    NULL,
    "LVM_SETGROUPINFO",
    NULL,
    "LVM_GETGROUPINFO",
    "LVM_REMOVEGROUP",
    "LVM_MOVEGROUP",
    NULL,
    NULL,
    "LVM_MOVEITEMTOGROUP",
    "LVM_SETGROUPMETRICS",
    "LVM_GETGROUPMETRICS",
    "LVM_ENABLEGROUPVIEW",
    "LVM_SORTGROUPS",
    "LVM_INSERTGROUPSORTED",
    "LVM_REMOVEALLGROUPS",
    "LVM_HASGROUP",
    "LVM_SETTILEVIEWINFO",
    "LVM_GETTILEVIEWINFO",
    "LVM_SETTILEINFO",
    "LVM_GETTILEINFO",
    "LVM_SETINSERTMARK",
    "LVM_GETINSERTMARK",
    "LVM_INSERTMARKHITTEST",
    "LVM_GETINSERTMARKRECT",
    "LVM_SETINSERTMARKCOLOR",
    "LVM_GETINSERTMARKCOLOR",
    NULL,
    "LVM_SETINFOTIP",
    "LVM_GETSELECTEDCOLUMN",
    "LVM_ISGROUPVIEWENABLED",
    "LVM_GETOUTLINECOLOR",
    "LVM_SETOUTLINECOLOR",
    NULL,
    "LVM_CANCELEDITLABEL",
    "LVM_MAPINDEXTOID",
    "LVM_MAPIDTOINDEX",
    "LVM_ISITEMVISIBLE"
927 928
};

929 930 931 932

#define SPY_MAX_TVMSGNUM   65
static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] =
{
933
    "TVM_INSERTITEMA",          /* 1100 */
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004
    "TVM_DELETEITEM",
    "TVM_EXPAND",
    NULL,
    "TVM_GETITEMRECT",
    "TVM_GETCOUNT",
    "TVM_GETINDENT",
    "TVM_SETINDENT",
    "TVM_GETIMAGELIST",
    "TVM_SETIMAGELIST",
    "TVM_GETNEXTITEM",
    "TVM_SELECTITEM",
    "TVM_GETITEMA",
    "TVM_SETITEMA",
    "TVM_EDITLABELA",
    "TVM_GETEDITCONTROL",
    "TVM_GETVISIBLECOUNT",
    "TVM_HITTEST",
    "TVM_CREATEDRAGIMAGE",
    "TVM_SORTCHILDREN",
    "TVM_ENSUREVISIBLE",
    "TVM_SORTCHILDRENCB",
    "TVM_ENDEDITLABELNOW",
    "TVM_GETISEARCHSTRINGA",
    "TVM_SETTOOLTIPS",
    "TVM_GETTOOLTIPS",
    "TVM_SETINSERTMARK",
    "TVM_SETITEMHEIGHT",
    "TVM_GETITEMHEIGHT",
    "TVM_SETBKCOLOR",
    "TVM_SETTEXTCOLOR",
    "TVM_GETBKCOLOR",
    "TVM_GETTEXTCOLOR",
    "TVM_SETSCROLLTIME",
    "TVM_GETSCROLLTIME",
    "TVM_UNKNOWN35",
    "TVM_UNKNOWN36",
    "TVM_SETINSERTMARKCOLOR",
    "TVM_GETINSERTMARKCOLOR",
    "TVM_GETITEMSTATE",
    "TVM_SETLINECOLOR",
    "TVM_GETLINECOLOR",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "TVM_INSERTITEMW",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "TVM_GETITEMW",
    "TVM_SETITEMW",
    "TVM_GETISEARCHSTRINGW",
    "TVM_EDITLABELW"
};


#define SPY_MAX_HDMMSGNUM   19
static const char * const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM + 1] =
{
1005
    "HDM_GETITEMCOUNT",         /* 1200 */
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
    "HDM_INSERTITEMA",
    "HDM_DELETEITEM",
    "HDM_GETITEMA",
    "HDM_SETITEMA",
    "HDM_LAYOUT",
    "HDM_HITTEST",
    "HDM_GETITEMRECT",
    "HDM_SETIMAGELIST",
    "HDM_GETIMAGELIST",
    "HDM_INSERTITEMW",
    "HDM_GETITEMW",
    "HDM_SETITEMW",
    NULL,
    NULL,
    "HDM_ORDERTOINDEX",
    "HDM_CREATEDRAGIMAGE",
    "GETORDERARRAYINDEX",
    "SETORDERARRAYINDEX",
    "SETHOTDIVIDER"
};


#define SPY_MAX_TCMMSGNUM   62
static const char * const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM + 1] =
{
1031
    NULL,               /* 1300 */
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098
    NULL,
    "TCM_SETIMAGELIST",
    "TCM_GETIMAGELIST",
    "TCM_GETITEMCOUNT",
    "TCM_GETITEMA",
    "TCM_SETITEMA",
    "TCM_INSERTITEMA",
    "TCM_DELETEITEM",
    "TCM_DELETEALLITEMS",
    "TCM_GETITEMRECT",
    "TCM_GETCURSEL",
    "TCM_SETCURSEL",
    "TCM_HITTEST",
    "TCM_SETITEMEXTRA",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "TCM_ADJUSTRECT",
    "TCM_SETITEMSIZE",
    "TCM_REMOVEIMAGE",
    "TCM_SETPADDING",
    "TCM_GETROWCOUNT",
    "TCM_GETTOOLTIPS",
    "TCM_SETTOOLTIPS",
    "TCM_GETCURFOCUS",
    "TCM_SETCURFOCUS",
    "TCM_SETMINTABWIDTH",
    "TCM_DESELECTALL",
    "TCM_HIGHLIGHTITEM",
    "TCM_SETEXTENDEDSTYLE",
    "TCM_GETEXTENDEDSTYLE",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    "TCM_GETITEMW",
    "TCM_SETITEMW",
    "TCM_INSERTITEMW"
};

#define SPY_MAX_PGMMSGNUM   13
static const char * const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM + 1] =
{
1099
    NULL,               /* 1400 */
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
    "PGM_SETCHILD",
    "PGM_RECALCSIZE",
    "PGM_FORWARDMOUSE",
    "PGM_SETBKCOLOR",
    "PGM_GETBKCOLOR",
    "PGM_SETBORDER",
    "PGM_GETBORDER",
    "PGM_SETPOS",
    "PGM_GETPOS",
    "PGM_SETBUTTONSIZE",
    "PGM_GETBUTTONSIZE",
    "PGM_GETBUTTONSTATE",
    "PGM_GETDROPTARGET"
};


1116
#define SPY_MAX_CCMMSGNUM   9
1117 1118
static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] =
{
1119
    NULL,               /* 0x2000 */
1120 1121 1122 1123 1124
    "CCM_SETBKCOLOR",
    "CCM_SETCOLORSCHEME",
    "CCM_GETCOLORSCHEME",
    "CCM_GETDROPTARGET",
    "CCM_SETUNICODEFORMAT",
1125 1126 1127 1128
    "CCM_GETUNICODEFORMAT",
    "CCM_SETVERSION",
    "CCM_GETVERSION",
    "CCM_SETNOTIFYWINDOW"
1129 1130
};

1131
#define SPY_MAX_WINEMSGNUM   (WM_WINE_MOUSE_LL_HOOK - WM_WINE_DESTROYWINDOW)
1132 1133 1134 1135 1136 1137 1138
static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] =
{
    "WM_WINE_DESTROYWINDOW",
    "WM_WINE_SETWINDOWPOS",
    "WM_WINE_SHOWWINDOW",
    "WM_WINE_SETPARENT",
    "WM_WINE_SETWINDOWLONG",
1139
    "WM_WINE_SETSTYLE",
1140 1141 1142
    "WM_WINE_SETACTIVEWINDOW",
    "WM_WINE_KEYBOARD_LL_HOOK",
    "WM_WINE_MOUSE_LL_HOOK",
1143 1144
};

1145 1146 1147 1148
/* Virtual key names */
#define SPY_MAX_VKKEYSNUM 255
static const char * const VK_KeyNames[SPY_MAX_VKKEYSNUM + 1] =
{
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176
    NULL,               /* 0x00 */
    "VK_LBUTTON",       /* 0x01 */
    "VK_RBUTTON",       /* 0x02 */
    "VK_CANCEL",        /* 0x03 */
    "VK_MBUTTON",       /* 0x04 */
    "VK_XBUTTON1",      /* 0x05 */
    "VK_XBUTTON2",      /* 0x06 */
    NULL,               /* 0x07 */
    "VK_BACK",          /* 0x08 */
    "VK_TAB",           /* 0x09 */
    NULL,               /* 0x0A */
    NULL,               /* 0x0B */
    "VK_CLEAR",         /* 0x0C */
    "VK_RETURN",        /* 0x0D */
    NULL,               /* 0x0E */
    NULL,               /* 0x0F */
    "VK_SHIFT",         /* 0x10 */
    "VK_CONTROL",       /* 0x11 */
    "VK_MENU",          /* 0x12 */
    "VK_PAUSE",         /* 0x13 */
    "VK_CAPITAL",       /* 0x14 */
    NULL,               /* 0x15 */
    NULL,               /* 0x16 */
    NULL,               /* 0x17 */
    NULL,               /* 0x18 */
    NULL,               /* 0x19 */
    NULL,               /* 0x1A */
    "VK_ESCAPE",        /* 0x1B */
1177 1178 1179 1180
    "VK_CONVERT",       /* 0x1C */
    "VK_NONCONVERT",    /* 0x1D */
    "VK_ACCEPT",        /* 0x1E */
    "VK_MODECHANGE",    /* 0x1F */
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243
    "VK_SPACE",         /* 0x20 */
    "VK_PRIOR",         /* 0x21 */
    "VK_NEXT",          /* 0x22 */
    "VK_END",           /* 0x23 */
    "VK_HOME",          /* 0x24 */
    "VK_LEFT",          /* 0x25 */
    "VK_UP",            /* 0x26 */
    "VK_RIGHT",         /* 0x27 */
    "VK_DOWN",          /* 0x28 */
    "VK_SELECT",        /* 0x29 */
    "VK_PRINT",         /* 0x2A */
    "VK_EXECUTE",       /* 0x2B */
    "VK_SNAPSHOT",      /* 0x2C */
    "VK_INSERT",        /* 0x2D */
    "VK_DELETE",        /* 0x2E */
    "VK_HELP",          /* 0x2F */
    "VK_0",             /* 0x30 */
    "VK_1",             /* 0x31 */
    "VK_2",             /* 0x32 */
    "VK_3",             /* 0x33 */
    "VK_4",             /* 0x34 */
    "VK_5",             /* 0x35 */
    "VK_6",             /* 0x36 */
    "VK_7",             /* 0x37 */
    "VK_8",             /* 0x38 */
    "VK_9",             /* 0x39 */
    NULL,               /* 0x3A */
    NULL,               /* 0x3B */
    NULL,               /* 0x3C */
    NULL,               /* 0x3D */
    NULL,               /* 0x3E */
    NULL,               /* 0x3F */
    NULL,               /* 0x40 */
    "VK_A",             /* 0x41 */
    "VK_B",             /* 0x42 */
    "VK_C",             /* 0x43 */
    "VK_D",             /* 0x44 */
    "VK_E",             /* 0x45 */
    "VK_F",             /* 0x46 */
    "VK_G",             /* 0x47 */
    "VK_H",             /* 0x48 */
    "VK_I",             /* 0x49 */
    "VK_J",             /* 0x4A */
    "VK_K",             /* 0x4B */
    "VK_L",             /* 0x4C */
    "VK_M",             /* 0x4D */
    "VK_N",             /* 0x4E */
    "VK_O",             /* 0x4F */
    "VK_P",             /* 0x50 */
    "VK_Q",             /* 0x51 */
    "VK_R",             /* 0x52 */
    "VK_S",             /* 0x53 */
    "VK_T",             /* 0x54 */
    "VK_U",             /* 0x55 */
    "VK_V",             /* 0x56 */
    "VK_W",             /* 0x57 */
    "VK_X",             /* 0x58 */
    "VK_Y",             /* 0x59 */
    "VK_Z",             /* 0x5A */
    "VK_LWIN",          /* 0x5B */
    "VK_RWIN",          /* 0x5C */
    "VK_APPS",          /* 0x5D */
    NULL,               /* 0x5E */
1244
    "VK_SLEEP",         /* 0x5F */
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294
    "VK_NUMPAD0",       /* 0x60 */
    "VK_NUMPAD1",       /* 0x61 */
    "VK_NUMPAD2",       /* 0x62 */
    "VK_NUMPAD3",       /* 0x63 */
    "VK_NUMPAD4",       /* 0x64 */
    "VK_NUMPAD5",       /* 0x65 */
    "VK_NUMPAD6",       /* 0x66 */
    "VK_NUMPAD7",       /* 0x67 */
    "VK_NUMPAD8",       /* 0x68 */
    "VK_NUMPAD9",       /* 0x69 */
    "VK_MULTIPLY",      /* 0x6A */
    "VK_ADD",           /* 0x6B */
    "VK_SEPARATOR",     /* 0x6C */
    "VK_SUBTRACT",      /* 0x6D */
    "VK_DECIMAL",       /* 0x6E */
    "VK_DIVIDE",        /* 0x6F */
    "VK_F1",            /* 0x70 */
    "VK_F2",            /* 0x71 */
    "VK_F3",            /* 0x72 */
    "VK_F4",            /* 0x73 */
    "VK_F5",            /* 0x74 */
    "VK_F6",            /* 0x75 */
    "VK_F7",            /* 0x76 */
    "VK_F8",            /* 0x77 */
    "VK_F9",            /* 0x78 */
    "VK_F10",           /* 0x79 */
    "VK_F11",           /* 0x7A */
    "VK_F12",           /* 0x7B */
    "VK_F13",           /* 0x7C */
    "VK_F14",           /* 0x7D */
    "VK_F15",           /* 0x7E */
    "VK_F16",           /* 0x7F */
    "VK_F17",           /* 0x80 */
    "VK_F18",           /* 0x81 */
    "VK_F19",           /* 0x82 */
    "VK_F20",           /* 0x83 */
    "VK_F21",           /* 0x84 */
    "VK_F22",           /* 0x85 */
    "VK_F23",           /* 0x86 */
    "VK_F24",           /* 0x87 */
    NULL,               /* 0x88 */
    NULL,               /* 0x89 */
    NULL,               /* 0x8A */
    NULL,               /* 0x8B */
    NULL,               /* 0x8C */
    NULL,               /* 0x8D */
    NULL,               /* 0x8E */
    NULL,               /* 0x8F */
    "VK_NUMLOCK",       /* 0x90 */
    "VK_SCROLL",        /* 0x91 */
1295 1296 1297 1298 1299
    "VK_OEM_NEC_EQUAL",       /* 0x92 aka. VK_OEM_FJ_JISHO */
    "VK_OEM_FJ_MASSHOU",      /* 0x93 */
    "VK_OEM_FJ_TOUROKU",      /* 0x94 */
    "VK_OEM_FJ_LOYA",         /* 0x95 */
    "VK_OEM_FJ_ROYA",         /* 0x96 */
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
    NULL,               /* 0x97 */
    NULL,               /* 0x98 */
    NULL,               /* 0x99 */
    NULL,               /* 0x9A */
    NULL,               /* 0x9B */
    NULL,               /* 0x9C */
    NULL,               /* 0x9D */
    NULL,               /* 0x9E */
    NULL,               /* 0x9F */
    "VK_LSHIFT",        /* 0xA0 */
    "VK_RSHIFT",        /* 0xA1 */
    "VK_LCONTROL",      /* 0xA2 */
    "VK_RCONTROL",      /* 0xA3 */
    "VK_LMENU",         /* 0xA4 */
    "VK_RMENU",         /* 0xA5 */
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332
    "VK_BROWSER_BACK",        /* 0xA6 */
    "VK_BROWSER_FORWARD",     /* 0xA7 */
    "VK_BROWSER_REFRESH",     /* 0xA8 */
    "VK_BROWSER_STOP",        /* 0xA9 */
    "VK_BROWSER_SEARCH",      /* 0xAA */
    "VK_BROWSER_FAVORITES",   /* 0xAB */
    "VK_BROWSER_HOME",        /* 0xAC */
    "VK_VOLUME_MUTE",         /* 0xAD */
    "VK_VOLUME_DOWN",         /* 0xAE */
    "VK_VOLUME_UP",           /* 0xAF */
    "VK_MEDIA_NEXT_TRACK",    /* 0xB0 */
    "VK_MEDIA_PREV_TRACK",    /* 0xB1 */
    "VK_MEDIA_STOP",          /* 0xB2 */
    "VK_MEDIA_PLAY_PAUSE",    /* 0xB3 */
    "VK_LAUNCH_MAIL",         /* 0xB4 */
    "VK_LAUNCH_MEDIA_SELECT", /* 0xB5 */
    "VK_LAUNCH_APP1",         /* 0xB6 */
    "VK_LAUNCH_APP2",         /* 0xB7 */
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
    NULL,               /* 0xB8 */
    NULL,               /* 0xB9 */
    "VK_OEM_1",         /* 0xBA */
    "VK_OEM_PLUS",      /* 0xBB */
    "VK_OEM_COMMA",     /* 0xBC */
    "VK_OEM_MINUS",     /* 0xBD */
    "VK_OEM_PERIOD",    /* 0xBE */
    "VK_OEM_2",         /* 0xBF */
    "VK_OEM_3",         /* 0xC0 */
    NULL,               /* 0xC1 */
    NULL,               /* 0xC2 */
    NULL,               /* 0xC3 */
    NULL,               /* 0xC4 */
    NULL,               /* 0xC5 */
    NULL,               /* 0xC6 */
    NULL,               /* 0xC7 */
    NULL,               /* 0xC8 */
    NULL,               /* 0xC9 */
    NULL,               /* 0xCA */
    NULL,               /* 0xCB */
    NULL,               /* 0xCC */
    NULL,               /* 0xCD */
    NULL,               /* 0xCE */
    NULL,               /* 0xCF */
    NULL,               /* 0xD0 */
    NULL,               /* 0xD1 */
    NULL,               /* 0xD2 */
    NULL,               /* 0xD3 */
    NULL,               /* 0xD4 */
    NULL,               /* 0xD5 */
    NULL,               /* 0xD6 */
    NULL,               /* 0xD7 */
    NULL,               /* 0xD8 */
    NULL,               /* 0xD9 */
    NULL,               /* 0xDA */
    "VK_OEM_4",         /* 0xDB */
    "VK_OEM_5",         /* 0xDC */
    "VK_OEM_6",         /* 0xDD */
    "VK_OEM_7",         /* 0xDE */
    "VK_OEM_8",         /* 0xDF */
    NULL,               /* 0xE0 */
    "VK_OEM_AX",        /* 0xE1 */
    "VK_OEM_102",       /* 0xE2 */
    "VK_ICO_HELP",      /* 0xE3 */
    "VK_ICO_00",        /* 0xE4 */
    "VK_PROCESSKEY",    /* 0xE5 */
    NULL,               /* 0xE6 */
1380
    "VK_PACKET",        /* 0xE7 */
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
    NULL,               /* 0xE8 */
    NULL,               /* 0xE9 */
    NULL,               /* 0xEA */
    NULL,               /* 0xEB */
    NULL,               /* 0xEC */
    NULL,               /* 0xED */
    NULL,               /* 0xEE */
    NULL,               /* 0xEF */
    NULL,               /* 0xF0 */
    NULL,               /* 0xF1 */
    NULL,               /* 0xF2 */
    NULL,               /* 0xF3 */
    NULL,               /* 0xF4 */
    NULL,               /* 0xF5 */
    "VK_ATTN",          /* 0xF6 */
    "VK_CRSEL",         /* 0xF7 */
    "VK_EXSEL",         /* 0xF8 */
    "VK_EREOF",         /* 0xF9 */
    "VK_PLAY",          /* 0xFA */
    "VK_ZOOM",          /* 0xFB */
    "VK_NONAME",        /* 0xFC */
    "VK_PA1",           /* 0xFD */
    "VK_OEM_CLEAR",     /* 0xFE */
    NULL                /* 0xFF */
1405 1406
};

1407

1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
/************************************************************************/


/* WM_USER+n message values for "common controls" */

typedef struct
{
    const char *name;      /* name of control message           */
    UINT        value;     /* message number (0x0401-0x0fff     */
    UINT        len;       /* length of space at lParam to dump */
} USER_MSG;


typedef struct
{
1423 1424 1425
    const WCHAR      *classname;  /* class name to match */
    const USER_MSG   *classmsg;   /* pointer to first USER_MSG for class */
    UINT              count;      /* number of entries */
1426 1427
} CONTROL_CLASS;

1428 1429 1430 1431 1432
#define USM(a,b) { #a ,a,b}
#define SZOF(a)  sizeof(a)

/* To dump memory at the lParam for any of these messages,  */
/* replace the "0" with a "SZOF(structure)", or with a      */
1433
/* number. (First method preferred.)                         */
1434

1435 1436
#define RB_GETBANDINFO_OLD (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */

1437
static const USER_MSG rebar_array[] = {
1438 1439 1440 1441
          USM(RB_INSERTBANDA,          0),
          USM(RB_DELETEBAND,           0),
          USM(RB_GETBARINFO,           0),
          USM(RB_SETBARINFO,           0),
1442
          USM(RB_GETBANDINFO_OLD,      0),
1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472
          USM(RB_SETBANDINFOA,         0),
          USM(RB_SETPARENT,            0),
          USM(RB_HITTEST,              0),
          USM(RB_GETRECT,              0),
          USM(RB_INSERTBANDW,          0),
          USM(RB_SETBANDINFOW,         0),
          USM(RB_GETBANDCOUNT,         0),
          USM(RB_GETROWCOUNT,          0),
          USM(RB_GETROWHEIGHT,         0),
          USM(RB_IDTOINDEX,            0),
          USM(RB_GETTOOLTIPS,          0),
          USM(RB_SETTOOLTIPS,          0),
          USM(RB_SETBKCOLOR,           0),
          USM(RB_GETBKCOLOR,           0),
          USM(RB_SETTEXTCOLOR,         0),
          USM(RB_GETTEXTCOLOR,         0),
          USM(RB_SIZETORECT,           0),
          USM(RB_BEGINDRAG,            0),
          USM(RB_ENDDRAG,              0),
          USM(RB_DRAGMOVE,             0),
          USM(RB_GETBARHEIGHT,         0),
          USM(RB_GETBANDINFOW,         0),
          USM(RB_GETBANDINFOA,         0),
          USM(RB_MINIMIZEBAND,         0),
          USM(RB_MAXIMIZEBAND,         0),
          USM(RB_GETBANDBORDERS,       0),
          USM(RB_SHOWBAND,             0),
          USM(RB_SETPALETTE,           0),
          USM(RB_GETPALETTE,           0),
          USM(RB_MOVEBAND,             0),
1473
};
1474 1475 1476 1477 1478 1479 1480

static const USER_MSG toolbar_array[] = {
          USM(TB_ENABLEBUTTON          ,0),
          USM(TB_CHECKBUTTON           ,0),
          USM(TB_PRESSBUTTON           ,0),
          USM(TB_HIDEBUTTON            ,0),
          USM(TB_INDETERMINATE         ,0),
1481
          USM(TB_MARKBUTTON            ,0),
1482 1483 1484
          USM(TB_ISBUTTONENABLED       ,0),
          USM(TB_ISBUTTONCHECKED       ,0),
          USM(TB_ISBUTTONPRESSED       ,0),
1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498
          USM(TB_ISBUTTONHIDDEN        ,0),
          USM(TB_ISBUTTONINDETERMINATE ,0),
          USM(TB_ISBUTTONHIGHLIGHTED   ,0),
          USM(TB_SETSTATE              ,0),
          USM(TB_GETSTATE              ,0),
          USM(TB_ADDBITMAP             ,0),
          USM(TB_ADDBUTTONSA           ,0),
          USM(TB_INSERTBUTTONA         ,0),
          USM(TB_DELETEBUTTON          ,0),
          USM(TB_GETBUTTON             ,0),
          USM(TB_BUTTONCOUNT           ,0),
          USM(TB_COMMANDTOINDEX        ,0),
          USM(TB_SAVERESTOREA          ,0),
          USM(TB_CUSTOMIZE             ,0),
1499
          USM(TB_ADDSTRINGA            ,0),
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
          USM(TB_GETITEMRECT           ,0),
          USM(TB_BUTTONSTRUCTSIZE      ,0),
          USM(TB_SETBUTTONSIZE         ,0),
          USM(TB_SETBITMAPSIZE         ,0),
          USM(TB_AUTOSIZE              ,0),
          USM(TB_GETTOOLTIPS           ,0),
          USM(TB_SETTOOLTIPS           ,0),
          USM(TB_SETPARENT             ,0),
          USM(TB_SETROWS               ,0),
          USM(TB_GETROWS               ,0),
          USM(TB_GETBITMAPFLAGS        ,0),
          USM(TB_SETCMDID              ,0),
          USM(TB_CHANGEBITMAP          ,0),
          USM(TB_GETBITMAP             ,0),
          USM(TB_GETBUTTONTEXTA        ,0),
          USM(TB_REPLACEBITMAP         ,0),
          USM(TB_SETINDENT             ,0),
          USM(TB_SETIMAGELIST          ,0),
          USM(TB_GETIMAGELIST          ,0),
          USM(TB_LOADIMAGES            ,0),
          USM(TB_GETRECT               ,0),
          USM(TB_SETHOTIMAGELIST       ,0),
          USM(TB_GETHOTIMAGELIST       ,0),
          USM(TB_SETDISABLEDIMAGELIST  ,0),
          USM(TB_GETDISABLEDIMAGELIST  ,0),
          USM(TB_SETSTYLE              ,0),
          USM(TB_GETSTYLE              ,0),
          USM(TB_GETBUTTONSIZE         ,0),
          USM(TB_SETBUTTONWIDTH        ,0),
          USM(TB_SETMAXTEXTROWS        ,0),
          USM(TB_GETTEXTROWS           ,0),
          USM(TB_GETOBJECT             ,0),
          USM(TB_GETBUTTONINFOW        ,0),
          USM(TB_SETBUTTONINFOW        ,0),
          USM(TB_GETBUTTONINFOA        ,0),
          USM(TB_SETBUTTONINFOA        ,0),
          USM(TB_INSERTBUTTONW         ,0),
          USM(TB_ADDBUTTONSW           ,0),
          USM(TB_HITTEST               ,0),
          USM(TB_SETDRAWTEXTFLAGS      ,0),
          USM(TB_GETHOTITEM            ,0),
          USM(TB_SETHOTITEM            ,0),
          USM(TB_SETANCHORHIGHLIGHT    ,0),
          USM(TB_GETANCHORHIGHLIGHT    ,0),
          USM(TB_GETBUTTONTEXTW        ,0),
          USM(TB_SAVERESTOREW          ,0),
1546
          USM(TB_ADDSTRINGW            ,0),
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559
          USM(TB_MAPACCELERATORA       ,0),
          USM(TB_GETINSERTMARK         ,0),
          USM(TB_SETINSERTMARK         ,0),
          USM(TB_INSERTMARKHITTEST     ,0),
          USM(TB_MOVEBUTTON            ,0),
          USM(TB_GETMAXSIZE            ,0),
          USM(TB_SETEXTENDEDSTYLE      ,0),
          USM(TB_GETEXTENDEDSTYLE      ,0),
          USM(TB_GETPADDING            ,0),
          USM(TB_SETPADDING            ,0),
          USM(TB_SETINSERTMARKCOLOR    ,0),
          USM(TB_GETINSERTMARKCOLOR    ,0),
          USM(TB_MAPACCELERATORW       ,0),
1560 1561
          USM(TB_GETSTRINGW            ,0),
          USM(TB_GETSTRINGA            ,0),
1562
          USM(TB_SETBOUNDINGSIZE       ,8),
1563
          USM(TB_SETHOTITEM2           ,0),
1564
          USM(TB_HASACCELERATOR        ,0),
1565 1566 1567
          USM(TB_SETLISTGAP            ,0),
          USM(TB_GETIMAGELISTCOUNT     ,0),
          USM(TB_GETIDEALSIZE          ,8),
1568
          USM(TB_UNKWN464              ,0),
1569
};
1570

1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598
static const USER_MSG tooltips_array[] = {
          USM(TTM_ACTIVATE             ,0),
          USM(TTM_SETDELAYTIME         ,0),
          USM(TTM_ADDTOOLA             ,0),
          USM(TTM_DELTOOLA             ,0),
          USM(TTM_NEWTOOLRECTA         ,0),
          USM(TTM_RELAYEVENT           ,0),
          USM(TTM_GETTOOLINFOA         ,0),
          USM(TTM_HITTESTA             ,0),
          USM(TTM_GETTEXTA             ,0),
          USM(TTM_UPDATETIPTEXTA       ,0),
          USM(TTM_GETTOOLCOUNT         ,0),
          USM(TTM_ENUMTOOLSA           ,0),
          USM(TTM_GETCURRENTTOOLA      ,0),
          USM(TTM_WINDOWFROMPOINT      ,0),
          USM(TTM_TRACKACTIVATE        ,0),
          USM(TTM_TRACKPOSITION        ,0),
          USM(TTM_SETTIPBKCOLOR        ,0),
          USM(TTM_SETTIPTEXTCOLOR      ,0),
          USM(TTM_GETDELAYTIME         ,0),
          USM(TTM_GETTIPBKCOLOR        ,0),
          USM(TTM_GETTIPTEXTCOLOR      ,0),
          USM(TTM_SETMAXTIPWIDTH       ,0),
          USM(TTM_GETMAXTIPWIDTH       ,0),
          USM(TTM_SETMARGIN            ,0),
          USM(TTM_GETMARGIN            ,0),
          USM(TTM_POP                  ,0),
          USM(TTM_UPDATE               ,0),
1599
          USM(TTM_GETBUBBLESIZE        ,0),
1600 1601 1602 1603 1604 1605 1606 1607 1608 1609
          USM(TTM_ADDTOOLW             ,0),
          USM(TTM_DELTOOLW             ,0),
          USM(TTM_NEWTOOLRECTW         ,0),
          USM(TTM_GETTOOLINFOW         ,0),
          USM(TTM_SETTOOLINFOW         ,0),
          USM(TTM_HITTESTW             ,0),
          USM(TTM_GETTEXTW             ,0),
          USM(TTM_UPDATETIPTEXTW       ,0),
          USM(TTM_ENUMTOOLSW           ,0),
          USM(TTM_GETCURRENTTOOLW      ,0),
1610
};
1611

1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626
static const USER_MSG comboex_array[] = {
          USM(CBEM_INSERTITEMA        ,0),
          USM(CBEM_SETIMAGELIST       ,0),
          USM(CBEM_GETIMAGELIST       ,0),
          USM(CBEM_GETITEMA           ,0),
          USM(CBEM_SETITEMA           ,0),
          USM(CBEM_GETCOMBOCONTROL    ,0),
          USM(CBEM_GETEDITCONTROL     ,0),
          USM(CBEM_SETEXSTYLE         ,0),
          USM(CBEM_GETEXTENDEDSTYLE   ,0),
          USM(CBEM_HASEDITCHANGED     ,0),
          USM(CBEM_INSERTITEMW        ,0),
          USM(CBEM_SETITEMW           ,0),
          USM(CBEM_GETITEMW           ,0),
          USM(CBEM_SETEXTENDEDSTYLE   ,0),
1627
};
1628

Guy Albertelli's avatar
Guy Albertelli committed
1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649
static const USER_MSG propsht_array[] = {
          USM(PSM_SETCURSEL           ,0),
          USM(PSM_REMOVEPAGE          ,0),
          USM(PSM_ADDPAGE             ,0),
          USM(PSM_CHANGED             ,0),
          USM(PSM_RESTARTWINDOWS      ,0),
          USM(PSM_REBOOTSYSTEM        ,0),
          USM(PSM_CANCELTOCLOSE       ,0),
          USM(PSM_QUERYSIBLINGS       ,0),
          USM(PSM_UNCHANGED           ,0),
          USM(PSM_APPLY               ,0),
          USM(PSM_SETTITLEA           ,0),
          USM(PSM_SETWIZBUTTONS       ,0),
          USM(PSM_PRESSBUTTON         ,0),
          USM(PSM_SETCURSELID         ,0),
          USM(PSM_SETFINISHTEXTA      ,0),
          USM(PSM_GETTABCONTROL       ,0),
          USM(PSM_ISDIALOGMESSAGE     ,0),
          USM(PSM_GETCURRENTPAGEHWND  ,0),
          USM(PSM_SETTITLEW           ,0),
          USM(PSM_SETFINISHTEXTW      ,0),
1650
};
1651
static const WCHAR PropSheetInfoStr[] =
1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668
    {'P','r','o','p','e','r','t','y','S','h','e','e','t','I','n','f','o',0 };

static const USER_MSG updown_array[] = {
          USM(UDM_SETRANGE            ,0),
          USM(UDM_GETRANGE            ,0),
          USM(UDM_SETPOS              ,0),
          USM(UDM_GETPOS              ,0),
          USM(UDM_SETBUDDY            ,0),
          USM(UDM_GETBUDDY            ,0),
          USM(UDM_SETACCEL            ,0),
          USM(UDM_GETACCEL            ,0),
          USM(UDM_SETBASE             ,0),
          USM(UDM_GETBASE             ,0),
          USM(UDM_SETRANGE32          ,0),
          USM(UDM_GETRANGE32          ,0),
          USM(UDM_SETPOS32            ,0),
          USM(UDM_GETPOS32            ,0),
1669
};
Guy Albertelli's avatar
Guy Albertelli committed
1670

1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751
/* generated from:
 * $ for i in `grep EM_ include/richedit.h | cut -d' ' -f2 | cut -f1`; do echo -e "          USM($i\t\t,0),"; done
 */
static const USER_MSG richedit_array[] = {
          {"EM_SCROLLCARET", WM_USER+49 ,0},
          USM(EM_CANPASTE               ,0),
          USM(EM_DISPLAYBAND            ,0),
          USM(EM_EXGETSEL               ,0),
          USM(EM_EXLIMITTEXT            ,0),
          USM(EM_EXLINEFROMCHAR         ,0),
          USM(EM_EXSETSEL               ,0),
          USM(EM_FINDTEXT               ,0),
          USM(EM_FORMATRANGE            ,0),
          USM(EM_GETCHARFORMAT          ,0),
          USM(EM_GETEVENTMASK           ,0),
          USM(EM_GETOLEINTERFACE        ,0),
          USM(EM_GETPARAFORMAT          ,0),
          USM(EM_GETSELTEXT             ,0),
          USM(EM_HIDESELECTION          ,0),
          USM(EM_PASTESPECIAL           ,0),
          USM(EM_REQUESTRESIZE          ,0),
          USM(EM_SELECTIONTYPE          ,0),
          USM(EM_SETBKGNDCOLOR          ,0),
          USM(EM_SETCHARFORMAT          ,0),
          USM(EM_SETEVENTMASK           ,0),
          USM(EM_SETOLECALLBACK         ,0),
          USM(EM_SETPARAFORMAT          ,0),
          USM(EM_SETTARGETDEVICE        ,0),
          USM(EM_STREAMIN               ,0),
          USM(EM_STREAMOUT              ,0),
          USM(EM_GETTEXTRANGE           ,0),
          USM(EM_FINDWORDBREAK          ,0),
          USM(EM_SETOPTIONS             ,0),
          USM(EM_GETOPTIONS             ,0),
          USM(EM_FINDTEXTEX             ,0),
          USM(EM_GETWORDBREAKPROCEX     ,0),
          USM(EM_SETWORDBREAKPROCEX     ,0),
          USM(EM_SETUNDOLIMIT           ,0),
          USM(EM_REDO                   ,0),
          USM(EM_CANREDO                ,0),
          USM(EM_GETUNDONAME            ,0),
          USM(EM_GETREDONAME            ,0),
          USM(EM_STOPGROUPTYPING        ,0),
          USM(EM_SETTEXTMODE            ,0),
          USM(EM_GETTEXTMODE            ,0),
          USM(EM_AUTOURLDETECT          ,0),
          USM(EM_GETAUTOURLDETECT       ,0),
          USM(EM_SETPALETTE             ,0),
          USM(EM_GETTEXTEX              ,0),
          USM(EM_GETTEXTLENGTHEX        ,0),
          USM(EM_SHOWSCROLLBAR          ,0),
          USM(EM_SETTEXTEX              ,0),
          USM(EM_SETPUNCTUATION         ,0),
          USM(EM_GETPUNCTUATION         ,0),
          USM(EM_SETWORDWRAPMODE        ,0),
          USM(EM_GETWORDWRAPMODE        ,0),
          USM(EM_SETIMECOLOR            ,0),
          USM(EM_GETIMECOLOR            ,0),
          USM(EM_SETIMEOPTIONS          ,0),
          USM(EM_GETIMEOPTIONS          ,0),
          USM(EM_CONVPOSITION           ,0),
          USM(EM_SETLANGOPTIONS         ,0),
          USM(EM_GETLANGOPTIONS         ,0),
          USM(EM_GETIMECOMPMODE         ,0),
          USM(EM_FINDTEXTW              ,0),
          USM(EM_FINDTEXTEXW            ,0),
          USM(EM_RECONVERSION           ,0),
          USM(EM_SETIMEMODEBIAS         ,0),
          USM(EM_GETIMEMODEBIAS         ,0),
          USM(EM_SETBIDIOPTIONS         ,0),
          USM(EM_GETBIDIOPTIONS         ,0),
          USM(EM_SETTYPOGRAPHYOPTIONS   ,0),
          USM(EM_GETTYPOGRAPHYOPTIONS   ,0),
          USM(EM_SETEDITSTYLE           ,0),
          USM(EM_GETEDITSTYLE           ,0),
          USM(EM_OUTLINE                ,0),
          USM(EM_GETSCROLLPOS           ,0),
          USM(EM_SETSCROLLPOS           ,0),
          USM(EM_SETFONTSIZE            ,0),
          USM(EM_GETZOOM                ,0),
          USM(EM_SETZOOM                ,0),
1752
};
1753

1754
#undef SZOF
1755 1756
#undef USM

1757 1758 1759 1760 1761 1762 1763 1764
static const CONTROL_CLASS cc_array[] = {
    {WC_COMBOBOXEXW,    comboex_array,  ARRAYSIZE(comboex_array) },
    {WC_PROPSHEETW,     propsht_array,  ARRAYSIZE(propsht_array) },
    {REBARCLASSNAMEW,   rebar_array,    ARRAYSIZE(rebar_array) },
    {TOOLBARCLASSNAMEW, toolbar_array,  ARRAYSIZE(toolbar_array) },
    {TOOLTIPS_CLASSW,   tooltips_array, ARRAYSIZE(tooltips_array) },
    {UPDOWN_CLASSW,     updown_array,   ARRAYSIZE(updown_array) },
    {RICHEDIT_CLASS20W, richedit_array, ARRAYSIZE(richedit_array) },
1765 1766 1767 1768 1769 1770
    {0, 0, 0} };


/************************************************************************/


1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787
/* WM_NOTIFY function codes display */

typedef struct
{
    const char *name;     /* name of notify message        */
    UINT        value;     /* notify code value             */
    UINT        len;       /* length of extra space to dump */
} SPY_NOTIFY;

#define SPNFY(a,b) { #a ,a,sizeof(b)-sizeof(NMHDR)}

/* Array MUST be in descending order by the 'value' field  */
/* (since value is UNSIGNED, 0xffffffff is largest and     */
/*  0xfffffffe is smaller). A binary search is used to     */
/* locate the correct 'value'.                             */
static const SPY_NOTIFY spnfy_array[] = {
    /*  common        0U       to  0U-99U  */
1788 1789
    SPNFY(NM_OUTOFMEMORY,        NMHDR),
    SPNFY(NM_CLICK,              NMHDR),
1790
    SPNFY(NM_DBLCLK,             NMHDR),
1791
    SPNFY(NM_RETURN,             NMHDR),
1792
    SPNFY(NM_RCLICK,             NMHDR),
1793
    SPNFY(NM_RDBLCLK,            NMHDR),
1794 1795 1796 1797
    SPNFY(NM_SETFOCUS,           NMHDR),
    SPNFY(NM_KILLFOCUS,          NMHDR),
    SPNFY(NM_CUSTOMDRAW,         NMCUSTOMDRAW),
    SPNFY(NM_HOVER,              NMHDR),
1798
    SPNFY(NM_NCHITTEST,          NMMOUSE),
1799 1800 1801 1802
    SPNFY(NM_KEYDOWN,            NMKEY),
    SPNFY(NM_RELEASEDCAPTURE,    NMHDR),
    SPNFY(NM_SETCURSOR,          NMMOUSE),
    SPNFY(NM_CHAR,               NMCHAR),
1803
    SPNFY(NM_TOOLTIPSCREATED,    NMTOOLTIPSCREATED),
1804
    /* Listview       0U-100U  to  0U-199U  */
1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820
    SPNFY(LVN_ITEMCHANGING,      NMLISTVIEW),
    SPNFY(LVN_ITEMCHANGED,       NMLISTVIEW),
    SPNFY(LVN_INSERTITEM,        NMLISTVIEW),
    SPNFY(LVN_DELETEITEM,        NMLISTVIEW),
    SPNFY(LVN_DELETEALLITEMS,    NMLISTVIEW),
    SPNFY(LVN_BEGINLABELEDITA,   NMLVDISPINFOA),
    SPNFY(LVN_ENDLABELEDITA,     NMLVDISPINFOA),
    SPNFY(LVN_COLUMNCLICK,       NMLISTVIEW),
    SPNFY(LVN_BEGINDRAG,         NMLISTVIEW),
    SPNFY(LVN_BEGINRDRAG,        NMLISTVIEW),
    SPNFY(LVN_ODCACHEHINT,       NMLVCACHEHINT),
    SPNFY(LVN_ITEMACTIVATE,      NMITEMACTIVATE),
    SPNFY(LVN_ODSTATECHANGED,    NMLVODSTATECHANGE),
    SPNFY(LVN_HOTTRACK,          NMLISTVIEW),
    SPNFY(LVN_GETDISPINFOA,      NMLVDISPINFOA),
    SPNFY(LVN_SETDISPINFOA,      NMLVDISPINFOA),
1821
    SPNFY(LVN_ODFINDITEMA,       NMLVFINDITEMA),
1822 1823 1824 1825 1826 1827 1828 1829
    SPNFY(LVN_KEYDOWN,           NMLVKEYDOWN),
    SPNFY(LVN_MARQUEEBEGIN,      NMLISTVIEW),
    SPNFY(LVN_GETINFOTIPA,       NMLVGETINFOTIPA),
    SPNFY(LVN_GETINFOTIPW,       NMLVGETINFOTIPW),
    SPNFY(LVN_BEGINLABELEDITW,   NMLVDISPINFOW),
    SPNFY(LVN_ENDLABELEDITW,     NMLVDISPINFOW),
    SPNFY(LVN_GETDISPINFOW,      NMLVDISPINFOW),
    SPNFY(LVN_SETDISPINFOW,      NMLVDISPINFOW),
1830
    SPNFY(LVN_ODFINDITEMW,       NMLVFINDITEMW),
Guy Albertelli's avatar
Guy Albertelli committed
1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841
    /* PropertySheet  0U-200U  to  0U-299U  */
    SPNFY(PSN_SETACTIVE,         PSHNOTIFY),
    SPNFY(PSN_KILLACTIVE,        PSHNOTIFY),
    SPNFY(PSN_APPLY,             PSHNOTIFY),
    SPNFY(PSN_RESET,             PSHNOTIFY),
    SPNFY(PSN_HELP,              PSHNOTIFY),
    SPNFY(PSN_WIZBACK,           PSHNOTIFY),
    SPNFY(PSN_WIZNEXT,           PSHNOTIFY),
    SPNFY(PSN_WIZFINISH,         PSHNOTIFY),
    SPNFY(PSN_QUERYCANCEL,       PSHNOTIFY),
    SPNFY(PSN_GETOBJECT,         NMOBJECTNOTIFY),
1842 1843
    SPNFY(PSN_TRANSLATEACCELERATOR, PSHNOTIFY),
    SPNFY(PSN_QUERYINITIALFOCUS, PSHNOTIFY),
1844
    /* Header         0U-300U  to  0U-399U  */
1845 1846 1847 1848 1849 1850 1851 1852 1853
    SPNFY(HDN_ITEMCHANGINGA,     NMHEADERA),
    SPNFY(HDN_ITEMCHANGEDA,      NMHEADERA),
    SPNFY(HDN_ITEMCLICKA,        NMHEADERA),
    SPNFY(HDN_ITEMDBLCLICKA,     NMHEADERA),
    SPNFY(HDN_DIVIDERDBLCLICKA,  NMHEADERA),
    SPNFY(HDN_BEGINTRACKA,       NMHEADERA),
    SPNFY(HDN_ENDTRACKA,         NMHEADERA),
    SPNFY(HDN_TRACKA,            NMHEADERA),
    SPNFY(HDN_GETDISPINFOA,      NMHEADERA),
1854 1855 1856 1857 1858 1859 1860 1861 1862
    SPNFY(HDN_BEGINDRAG,         NMHDR),
    SPNFY(HDN_ENDDRAG,           NMHDR),
    SPNFY(HDN_ITEMCHANGINGW,     NMHDR),
    SPNFY(HDN_ITEMCHANGEDW,      NMHDR),
    SPNFY(HDN_ITEMCLICKW,        NMHDR),
    SPNFY(HDN_ITEMDBLCLICKW,     NMHDR),
    SPNFY(HDN_DIVIDERDBLCLICKW,  NMHDR),
    SPNFY(HDN_BEGINTRACKW,       NMHDR),
    SPNFY(HDN_ENDTRACKW,         NMHDR),
1863
    SPNFY(HDN_TRACKW,            NMHDR),
1864
    SPNFY(HDN_GETDISPINFOW,      NMHDR),
1865
    /* Treeview       0U-400U  to  0U-499U  */
1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888
    SPNFY(TVN_SELCHANGINGA,      NMTREEVIEWA),
    SPNFY(TVN_SELCHANGEDA,       NMTREEVIEWA),
    SPNFY(TVN_GETDISPINFOA,      NMTVDISPINFOA),
    SPNFY(TVN_SETDISPINFOA,      NMTVDISPINFOA),
    SPNFY(TVN_ITEMEXPANDINGA,    NMTREEVIEWA),
    SPNFY(TVN_ITEMEXPANDEDA,     NMTREEVIEWA),
    SPNFY(TVN_BEGINDRAGA,        NMTREEVIEWA),
    SPNFY(TVN_BEGINRDRAGA,       NMTREEVIEWA),
    SPNFY(TVN_DELETEITEMA,       NMTREEVIEWA),
    SPNFY(TVN_BEGINLABELEDITA,   NMTVDISPINFOA),
    SPNFY(TVN_ENDLABELEDITA,     NMTVDISPINFOA),
    SPNFY(TVN_KEYDOWN,           NMTVKEYDOWN),
    SPNFY(TVN_SELCHANGINGW,      NMTREEVIEWW),
    SPNFY(TVN_SELCHANGEDW,       NMTREEVIEWW),
    SPNFY(TVN_GETDISPINFOW,      NMTVDISPINFOW),
    SPNFY(TVN_SETDISPINFOW,      NMTVDISPINFOW),
    SPNFY(TVN_ITEMEXPANDINGW,    NMTREEVIEWW),
    SPNFY(TVN_ITEMEXPANDEDW,     NMTREEVIEWW),
    SPNFY(TVN_BEGINDRAGW,        NMTREEVIEWW),
    SPNFY(TVN_BEGINRDRAGW,       NMTREEVIEWW),
    SPNFY(TVN_DELETEITEMW,       NMTREEVIEWW),
    SPNFY(TVN_BEGINLABELEDITW,   NMTVDISPINFOW),
    SPNFY(TVN_ENDLABELEDITW,     NMTVDISPINFOW),
1889
    /* Tooltips       0U-520U  to  0U-549U  */
1890 1891 1892 1893
    SPNFY(TTN_GETDISPINFOA,      NMHDR),
    SPNFY(TTN_SHOW,              NMHDR),
    SPNFY(TTN_POP,               NMHDR),
    SPNFY(TTN_GETDISPINFOW,      NMHDR),
1894
    /* Tab            0U-550U  to  0U-580U  */
1895 1896 1897 1898
    SPNFY(TCN_KEYDOWN,           NMHDR),
    SPNFY(TCN_SELCHANGE,         NMHDR),
    SPNFY(TCN_SELCHANGING,       NMHDR),
    SPNFY(TCN_GETOBJECT,         NMHDR),
1899
    /* Common Dialog  0U-601U  to  0U-699U  */
1900 1901 1902 1903 1904 1905 1906
    SPNFY(CDN_INITDONE,          OFNOTIFYA),
    SPNFY(CDN_SELCHANGE,         OFNOTIFYA),
    SPNFY(CDN_FOLDERCHANGE,      OFNOTIFYA),
    SPNFY(CDN_SHAREVIOLATION,    OFNOTIFYA),
    SPNFY(CDN_HELP,              OFNOTIFYA),
    SPNFY(CDN_FILEOK,            OFNOTIFYA),
    SPNFY(CDN_TYPECHANGE,        OFNOTIFYA),
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
    /* Toolbar        0U-700U  to  0U-720U  */
    SPNFY(TBN_GETBUTTONINFOA,    NMTOOLBARA),
    SPNFY(TBN_BEGINDRAG,         NMTOOLBARA),
    SPNFY(TBN_ENDDRAG,           NMTOOLBARA),
    SPNFY(TBN_BEGINADJUST,       NMHDR),
    SPNFY(TBN_ENDADJUST,         NMHDR),
    SPNFY(TBN_RESET,             NMHDR),
    SPNFY(TBN_QUERYINSERT,       NMTOOLBARA),
    SPNFY(TBN_QUERYDELETE,       NMTOOLBARA),
    SPNFY(TBN_TOOLBARCHANGE,     NMHDR),
    SPNFY(TBN_CUSTHELP,          NMHDR),
    SPNFY(TBN_DROPDOWN,          NMTOOLBARA),
    SPNFY(TBN_GETOBJECT,         NMOBJECTNOTIFY),
1920
    SPNFY(TBN_HOTITEMCHANGE,     NMTBHOTITEM),
1921 1922
    SPNFY(TBN_DRAGOUT,           NMTOOLBARA),
    SPNFY(TBN_DELETINGBUTTON,    NMTOOLBARA),
1923 1924
    SPNFY(TBN_GETDISPINFOA,      NMTBDISPINFOA),
    SPNFY(TBN_GETDISPINFOW,      NMTBDISPINFOW),
1925 1926 1927 1928
    SPNFY(TBN_GETINFOTIPA,       NMTBGETINFOTIPA),
    SPNFY(TBN_GETINFOTIPW,       NMTBGETINFOTIPW),
    SPNFY(TBN_GETBUTTONINFOW,    NMTOOLBARW),
    /* Up/Down        0U-721U  to  0U-740U  */
1929
    SPNFY(UDN_DELTAPOS,          NM_UPDOWN),
1930
    /* Month Calendar 0U-750U  to  0U-759U  */
1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
    /* ******************* WARNING ***************************** */
    /* The following appear backwards but needs to be this way.  */
    /* The reason is that MS (and us) define the MCNs as         */
    /*         MCN_FIRST + n                                     */
    /* instead of the way ALL other notifications are            */
    /*         TBN_FIRST - n                                     */
    /* The only place that this is important is in this list     */
    /*                                                           */
    /* Also since the same error was made with the DTN_ items,   */
    /* they overlay the MCN_ and need to be inserted in the      */
    /* other section of the table so that it is in order for     */
    /* the binary search.                                        */
    /*                                                           */
    /* Thank you MS for your obvious quality control!!           */
    /* ******************* WARNING ***************************** */
1946
    /* Date/Time      0U-760U  to  0U-799U  */
1947 1948 1949
    /* SPNFY(MCN_SELECT,            NMHDR), */
    /* SPNFY(MCN_GETDAYSTATE,       NMHDR), */
    /* SPNFY(MCN_SELCHANGE,         NMHDR), */
1950 1951 1952 1953 1954 1955 1956 1957
    /* ******************* WARNING ***************************** */
    /* The following appear backwards but needs to be this way.  */
    /* The reason is that MS (and us) define the MCNs as         */
    /*         DTN_FIRST + n                                     */
    /* instead of the way ALL other notifications are            */
    /*         TBN_FIRST - n                                     */
    /* The only place that this is important is in this list     */
    /* ******************* WARNING ***************************** */
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971
    SPNFY(DTN_FORMATQUERYW,      NMHDR),
    SPNFY(DTN_FORMATW,           NMHDR),
    SPNFY(DTN_WMKEYDOWNW,        NMHDR),
    SPNFY(DTN_USERSTRINGW,       NMHDR),
    SPNFY(MCN_SELECT,            NMHDR),
    SPNFY(MCN_GETDAYSTATE,       NMHDR),
    SPNFY(MCN_SELCHANGE,         NMHDR),
    SPNFY(DTN_CLOSEUP,           NMHDR),
    SPNFY(DTN_DROPDOWN,          NMHDR),
    SPNFY(DTN_FORMATQUERYA,      NMHDR),
    SPNFY(DTN_FORMATA,           NMHDR),
    SPNFY(DTN_WMKEYDOWNA,        NMHDR),
    SPNFY(DTN_USERSTRINGA,       NMHDR),
    SPNFY(DTN_DATETIMECHANGE,    NMHDR),
1972
    /* ComboBoxEx     0U-800U  to  0U-830U  */
1973 1974 1975
    SPNFY(CBEN_GETDISPINFOA,     NMCOMBOBOXEXA),
    SPNFY(CBEN_INSERTITEM,       NMCOMBOBOXEXA),
    SPNFY(CBEN_DELETEITEM,       NMCOMBOBOXEXA),
1976
    SPNFY(CBEN_BEGINEDIT,        NMHDR),
1977 1978
    SPNFY(CBEN_ENDEDITA,         NMCBEENDEDITA),
    SPNFY(CBEN_ENDEDITW,         NMCBEENDEDITW),
1979 1980 1981
    SPNFY(CBEN_GETDISPINFOW,     NMCOMBOBOXEXW),
    SPNFY(CBEN_DRAGBEGINA,       NMCBEDRAGBEGINA),
    SPNFY(CBEN_DRAGBEGINW,       NMCBEDRAGBEGINW),
1982 1983 1984 1985 1986 1987 1988 1989 1990 1991
    /* Rebar          0U-831U  to  0U-859U  */
    SPNFY(RBN_HEIGHTCHANGE,      NMHDR),
    SPNFY(RBN_GETOBJECT,         NMOBJECTNOTIFY),
    SPNFY(RBN_LAYOUTCHANGED,     NMHDR),
    SPNFY(RBN_AUTOSIZE,          NMRBAUTOSIZE),
    SPNFY(RBN_BEGINDRAG,         NMREBAR),
    SPNFY(RBN_ENDDRAG,           NMREBAR),
    SPNFY(RBN_DELETINGBAND,      NMREBAR),
    SPNFY(RBN_DELETEDBAND,       NMREBAR),
    SPNFY(RBN_CHILDSIZE,         NMREBARCHILDSIZE),
Austin English's avatar
Austin English committed
1992
    /* IP address     0U-860U  to  0U-879U  */
1993
    SPNFY(IPN_FIELDCHANGED,      NMHDR),
1994
    /* Status bar     0U-880U  to  0U-899U  */
1995
    SPNFY(SBN_SIMPLEMODECHANGE,  NMHDR),
1996
    /* Pager          0U-900U  to  0U-950U  */
1997 1998
    SPNFY(PGN_SCROLL,            NMPGSCROLL),
    SPNFY(PGN_CALCSIZE,          NMPGCALCSIZE),
1999
};
2000 2001
#undef SPNFY

2002
static unsigned char *spy_exclude;
Alexandre Julliard's avatar
Alexandre Julliard committed
2003

2004 2005 2006 2007 2008 2009 2010 2011 2012
static inline BOOL exclude_msg( UINT msg )
{
    return spy_exclude[ min( msg, SPY_MAX_MSGNUM ) ];
}

static inline BOOL exclude_dwp(void)
{
    return spy_exclude[SPY_MAX_MSGNUM + 1];
}
Alexandre Julliard's avatar
Alexandre Julliard committed
2013

2014 2015 2016 2017 2018 2019 2020 2021 2022

typedef struct
{
    UINT       msgnum;           /* message number */
    HWND       msg_hwnd;         /* window handle for message          */
    WPARAM     wParam;           /* message parameter                  */
    LPARAM     lParam;           /* message parameter                  */
    INT        data_len;         /* length of data to dump             */
    char       msg_name[60];     /* message name (see SPY_GetMsgName)  */
2023 2024
    WCHAR      wnd_class[60];    /* window class name (full)           */
    WCHAR      wnd_name[16];     /* window name for message            */
2025 2026
} SPY_INSTANCE;

2027
static int indent_tls_index = TLS_OUT_OF_INDEXES;
2028 2029 2030 2031

/***********************************************************************
 *           get_indent_level
 */
2032
static inline INT_PTR get_indent_level(void)
2033
{
2034
    return (INT_PTR)TlsGetValue( indent_tls_index );
2035 2036 2037 2038 2039 2040
}


/***********************************************************************
 *           set_indent_level
 */
2041
static inline void set_indent_level( INT_PTR level )
2042 2043 2044 2045
{
    TlsSetValue( indent_tls_index, (void *)level );
}

2046

Alexandre Julliard's avatar
Alexandre Julliard committed
2047
/***********************************************************************
2048
 *           SPY_GetMsgInternal
Alexandre Julliard's avatar
Alexandre Julliard committed
2049
 */
2050
static const char *SPY_GetMsgInternal( UINT msg )
Alexandre Julliard's avatar
Alexandre Julliard committed
2051
{
Alexandre Julliard's avatar
Alexandre Julliard committed
2052 2053
    if (msg <= SPY_MAX_MSGNUM)
        return MessageTypeNames[msg];
2054 2055 2056 2057

    if (msg >= LVM_FIRST && msg <= LVM_FIRST + SPY_MAX_LVMMSGNUM)
        return LVMMessageTypeNames[msg-LVM_FIRST];

2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069
    if (msg >= TV_FIRST && msg <= TV_FIRST + SPY_MAX_TVMSGNUM)
        return TVMessageTypeNames[msg-TV_FIRST];

    if (msg >= HDM_FIRST && msg <= HDM_FIRST + SPY_MAX_HDMMSGNUM)
        return HDMMessageTypeNames[msg-HDM_FIRST];

    if (msg >= TCM_FIRST && msg <= TCM_FIRST + SPY_MAX_TCMMSGNUM)
        return TCMMessageTypeNames[msg-TCM_FIRST];

    if (msg >= PGM_FIRST && msg <= PGM_FIRST + SPY_MAX_PGMMSGNUM)
        return PGMMessageTypeNames[msg-PGM_FIRST];

2070 2071 2072
    if (msg >= CCM_FIRST && msg <= CCM_FIRST + SPY_MAX_CCMMSGNUM)
        return CCMMessageTypeNames[msg-CCM_FIRST];

2073 2074
    if (msg >= WM_WINE_DESTROYWINDOW && msg <= WM_WINE_DESTROYWINDOW + SPY_MAX_WINEMSGNUM)
        return WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW];
2075 2076

    return NULL;
Alexandre Julliard's avatar
Alexandre Julliard committed
2077 2078
}

Alexandre Julliard's avatar
Alexandre Julliard committed
2079
/***********************************************************************
2080 2081
 *           SPY_Bsearch_Msg
 */
2082
static const USER_MSG *SPY_Bsearch_Msg( const USER_MSG *msgs, UINT count, UINT code)
2083
{
2084
    int low = 0, high = count - 1;
2085

2086 2087 2088 2089 2090 2091
    while (low <= high)
    {
        int idx = (low + high) / 2;
        if (msgs[idx].value == code) return msgs + idx;
        if (msgs[idx].value > code)
            high = idx - 1;
2092
        else
2093
            low = idx + 1;
2094 2095 2096 2097
    }
    return NULL;
}

2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114
/***********************************************************************
 *           SPY_GetClassLongOffsetName
 *
 * Gets the name of a class long offset.
 */
const char *SPY_GetClassLongOffsetName( INT offset )
{
    INT index;
    if (offset < 0 && offset % 2 == 0 && ((index = -(offset + 8) / 2) <
	sizeof(ClassLongOffsetNames) / sizeof(*ClassLongOffsetNames)))
    {
        return ClassLongOffsetNames[index];
    }

    return "?";
}

2115 2116 2117 2118 2119 2120 2121 2122
/***********************************************************************
 *           SPY_GetClassName
 *
 *  Sets the value of "wnd_class" member of the instance structure.
 */
static void SPY_GetClassName( SPY_INSTANCE *sp_e )
{
    /* special code to detect a property sheet dialog   */
2123
    if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == WC_DIALOG) &&
2124 2125 2126 2127 2128 2129 2130 2131
        (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) {
        strcpyW(sp_e->wnd_class, WC_PROPSHEETW);
    }
    else {
        GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, sizeof(sp_e->wnd_class)/sizeof(WCHAR));
    }
}

2132 2133 2134 2135
/***********************************************************************
 *           SPY_GetMsgStuff
 *
 *  Get message name and other information for dumping
Alexandre Julliard's avatar
Alexandre Julliard committed
2136
 */
2137
static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
Alexandre Julliard's avatar
Alexandre Julliard committed
2138
{
2139
    const USER_MSG *p;
2140
    const char *msg_name = SPY_GetMsgInternal( sp_e->msgnum );
2141

2142
    sp_e->data_len = 0;
2143
    if (!msg_name)
2144
    {
2145
        INT i = 0;
2146

2147 2148 2149 2150 2151 2152 2153 2154 2155
        if (sp_e->msgnum >= 0xc000)
        {
            if (GlobalGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
            {
                sp_e->msg_name[0] = '\"';
                strcat( sp_e->msg_name, "\"" );
                return;
            }
        }
2156 2157
        if (!sp_e->wnd_class[0]) SPY_GetClassName(sp_e);

2158
#if DEBUG_SPY
2159
        TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class));
2160
#endif
2161

2162 2163
        while (cc_array[i].classname &&
               strcmpiW(cc_array[i].classname, sp_e->wnd_class) != 0) i++;
2164

2165
        if (cc_array[i].classname)
2166
        {
2167
#if DEBUG_SPY
2168 2169 2170
            TRACE("process class %s, first %p, last %p\n",
                  debugstr_w(cc_array[i].classname), cc_array[i].classmsg,
                  cc_array[i].lastmsg);
2171
#endif
2172
            p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].count, sp_e->msgnum);
2173
            if (p) {
2174
                lstrcpynA (sp_e->msg_name, p->name, sizeof(sp_e->msg_name));
2175 2176 2177 2178
                sp_e->data_len = p->len;
                return;
            }
        }
2179 2180 2181 2182
        if (sp_e->msgnum >= WM_USER && sp_e->msgnum <= WM_APP)
            sprintf( sp_e->msg_name, "WM_USER+%d", sp_e->msgnum - WM_USER );
        else
            sprintf( sp_e->msg_name, "%04x", sp_e->msgnum );
2183 2184 2185
    }
    else
    {
2186
        lstrcpynA(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name));
2187 2188 2189 2190 2191 2192
    }
}

/***********************************************************************
 *           SPY_GetWndName
 *
2193
 *  Sets the value of "wnd_name" and "wnd_class" members of the
2194 2195 2196
 *  instance structure.
 *
 */
2197
static void SPY_GetWndName( SPY_INSTANCE *sp_e )
2198
{
2199
    INT len;
2200

2201
    SPY_GetClassName( sp_e );
2202

2203 2204
    len = InternalGetWindowText(sp_e->msg_hwnd, sp_e->wnd_name, sizeof(sp_e->wnd_name)/sizeof(WCHAR));
    if(!len) /* get class name */
2205
    {
2206 2207 2208 2209 2210 2211 2212
        LPWSTR dst = sp_e->wnd_name;
        LPWSTR src = sp_e->wnd_class;
        int n = sizeof(sp_e->wnd_name)/sizeof(WCHAR) - 3;
        *dst++ = '{';
        while ((n-- > 0) && *src) *dst++ = *src++;
        *dst++ = '}';
        *dst = 0;
2213
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
2214
}
2215

2216 2217 2218
/***********************************************************************
 *           SPY_GetMsgName
 *
2219
 *  ****  External function  ****
2220 2221 2222 2223 2224
 *
 *  Get message name
 */
const char *SPY_GetMsgName( UINT msg, HWND hWnd )
{
2225
    SPY_INSTANCE ext_sp_e;
2226
    DWORD save_error = GetLastError();
2227

2228 2229 2230 2231
    ext_sp_e.msgnum = msg;
    ext_sp_e.msg_hwnd   = hWnd;
    ext_sp_e.lParam = 0;
    ext_sp_e.wParam = 0;
2232
    ext_sp_e.wnd_class[0] = 0;
2233
    SPY_GetMsgStuff(&ext_sp_e);
2234
    SetLastError( save_error );
2235
    return wine_dbg_sprintf("%s", ext_sp_e.msg_name);
2236 2237
}

2238 2239 2240 2241 2242 2243 2244 2245
/***********************************************************************
 *           SPY_GetVKeyName
 */
const char *SPY_GetVKeyName(WPARAM wParam)
{
    const char *vk_key_name;

    if(wParam <= SPY_MAX_VKKEYSNUM && VK_KeyNames[wParam])
2246
        vk_key_name = VK_KeyNames[wParam];
2247
    else
2248
        vk_key_name = "VK_???";
2249 2250 2251 2252

    return vk_key_name;
}

2253 2254 2255
/***********************************************************************
 *           SPY_Bsearch_Notify
 */
2256
static const SPY_NOTIFY *SPY_Bsearch_Notify( UINT code)
2257
{
2258
    int low = 0, high = ARRAYSIZE(spnfy_array) - 1;
2259

2260 2261 2262 2263 2264 2265
    while (low <= high)
    {
        int idx = (low + high) / 2;
        if (spnfy_array[idx].value == code) return spnfy_array + idx;
        if (spnfy_array[idx].value < code)
            high = idx - 1;
2266
        else
2267
            low = idx + 1;
2268 2269 2270 2271
    }
    return NULL;
}

2272 2273 2274
/***********************************************************************
 *           SPY_DumpMem
 */
2275
static void SPY_DumpMem (LPCSTR header, const UINT *q, INT len)
2276 2277 2278 2279
{
    int i;

    for(i=0; i<len-12; i+=16) {
2280 2281 2282
        TRACE("%s [%04x] %08x %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2), *(q+3));
        q += 4;
2283
    }
2284 2285
    switch ((len - i + 3) & (~3)) {
    case 16:
2286 2287 2288
        TRACE("%s [%04x] %08x %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2), *(q+3));
        break;
2289
    case 12:
2290 2291 2292
        TRACE("%s [%04x] %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2));
        break;
2293
    case 8:
2294 2295 2296
        TRACE("%s [%04x] %08x %08x\n",
              header, i, *q, *(q+1));
        break;
2297
    case 4:
2298 2299 2300
        TRACE("%s [%04x] %08x\n",
              header, i, *q);
        break;
2301
    default:
2302
        break;
2303 2304 2305
    }
}

2306 2307 2308
/***********************************************************************
 *           SPY_DumpStructure
 */
2309
static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
2310
{
2311
    switch (sp_e->msgnum)
2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344
        {
        case LVM_INSERTITEMW:
        case LVM_SETITEMW:
            if (!enter) break;
            /* fall through */
        case LVM_GETITEMW:
            {
                LPLVITEMA item = (LPLVITEMA) sp_e->lParam;
                if (item) {
                    SPY_DumpMem ("LVITEM", (UINT*)item, sizeof(LVITEMA));
                }
                break;
            }
        case TCM_INSERTITEMW:
        case TCM_INSERTITEMA:
        case TCM_SETITEMW:
        case TCM_SETITEMA:
            if (!enter) break;
            /* fall through */
        case TCM_GETITEMW:
        case TCM_GETITEMA:
            {
                TCITEMA *item = (TCITEMA *) sp_e->lParam;
                if (item) {
                    SPY_DumpMem ("TCITEM", (UINT*)item, sizeof(TCITEMA));
                }
                break;
            }
        case TCM_ADJUSTRECT:
        case LVM_GETITEMRECT:
        case LVM_GETSUBITEMRECT:
            {
                LPRECT rc = (LPRECT) sp_e->lParam;
2345 2346
                if (rc)
                    TRACE("lParam rect (%s)\n", wine_dbgstr_rect(rc));
2347 2348 2349 2350 2351 2352 2353 2354 2355 2356
                break;
            }
        case LVM_SETITEMPOSITION32:
            if (!enter) break;
            /* fall through */
        case LVM_GETITEMPOSITION:
        case LVM_GETORIGIN:
            {
                LPPOINT point = (LPPOINT) sp_e->lParam;
                if (point) {
2357
                    TRACE("lParam point x=%d, y=%d\n", point->x, point->y);
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382
                }
                break;
            }
        case SBM_SETRANGE:
            if (!enter && (sp_e->msgnum == SBM_SETRANGE)) break;
            TRACE("min=%d max=%d\n", (INT)sp_e->wParam, (INT)sp_e->lParam);
            break;
        case SBM_GETRANGE:
            if ((enter && (sp_e->msgnum == SBM_GETRANGE)) ||
                (!enter && (sp_e->msgnum == SBM_SETRANGE))) break;
            {
                LPINT ptmin = (LPINT) sp_e->wParam;
                LPINT ptmax = (LPINT) sp_e->lParam;
                if (ptmin && ptmax)
                    TRACE("min=%d max=%d\n", *ptmin, *ptmax);
                else if (ptmin)
                    TRACE("min=%d max=n/a\n", *ptmin);
                else if (ptmax)
                    TRACE("min=n/a max=%d\n", *ptmax);
                break;
            }
        case EM_EXSETSEL:
            if (enter && sp_e->lParam)
            {
                CHARRANGE *cr = (CHARRANGE *) sp_e->lParam;
2383
                TRACE("CHARRANGE: cpMin=%d cpMax=%d\n", cr->cpMin, cr->cpMax);
2384 2385 2386 2387 2388 2389
            }
            break;
        case EM_SETCHARFORMAT:
            if (enter && sp_e->lParam)
            {
                CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam;
2390
                TRACE("CHARFORMAT: dwMask=0x%08x dwEffects=", cf->dwMask);
2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404
                if ((cf->dwMask & CFM_BOLD) && (cf->dwEffects & CFE_BOLD))
                    TRACE(" CFE_BOLD");
                if ((cf->dwMask & CFM_COLOR) && (cf->dwEffects & CFE_AUTOCOLOR))
                    TRACE(" CFE_AUTOCOLOR");
                if ((cf->dwMask & CFM_ITALIC) && (cf->dwEffects & CFE_ITALIC))
                    TRACE(" CFE_ITALIC");
                if ((cf->dwMask & CFM_PROTECTED) && (cf->dwEffects & CFE_PROTECTED))
                    TRACE(" CFE_PROTECTED");
                if ((cf->dwMask & CFM_STRIKEOUT) && (cf->dwEffects & CFE_STRIKEOUT))
                    TRACE(" CFE_STRIKEOUT");
                if ((cf->dwMask & CFM_UNDERLINE) && (cf->dwEffects & CFE_UNDERLINE))
                    TRACE(" CFE_UNDERLINE");
                TRACE("\n");
                if (cf->dwMask & CFM_SIZE)
2405
                    TRACE("yHeight=%d\n", cf->yHeight);
2406
                if (cf->dwMask & CFM_OFFSET)
2407
                    TRACE("yOffset=%d\n", cf->yOffset);
2408
                if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR))
2409
                    TRACE("crTextColor=%x\n", cf->crTextColor);
2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425
                TRACE("bCharSet=%x bPitchAndFamily=%x\n", cf->bCharSet, cf->bPitchAndFamily);
                /* FIXME: we should try to be a bit more intelligent about
                 * whether this is in ANSI or Unicode (it could be either) */
                if (cf->dwMask & CFM_FACE)
                    TRACE("szFaceName=%s\n", debugstr_wn(cf->szFaceName, LF_FACESIZE));
                /* FIXME: handle CHARFORMAT2 too */
            }
            break;
        case WM_DRAWITEM:
            if (!enter) break;
            {
                DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam;
                TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
                      lpdis->CtlType, lpdis->CtlID);
                TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
                      lpdis->itemID, lpdis->itemAction, lpdis->itemState);
2426 2427 2428
                TRACE("hWnd=%p hDC=%p (%s) itemData=0x%08lx\n",
                      lpdis->hwndItem, lpdis->hDC,
                      wine_dbgstr_rect(&lpdis->rcItem), lpdis->itemData);
2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440
            }
            break;
        case WM_MEASUREITEM:
            {
                MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam;
                TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
                      lpmis->CtlType, lpmis->CtlID);
                TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n",
                      lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight);
                TRACE("itemData=0x%08lx\n", lpmis->itemData);
            }
            break;
2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457
        case WM_NCCREATE:
        case WM_CREATE:
        {
            BOOL unicode;
            CREATESTRUCTA *cs;

            if (!enter) break;

            unicode = IsWindowUnicode(sp_e->msg_hwnd);
            cs = (CREATESTRUCTA *)sp_e->lParam;
            TRACE("%s %s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n",
                  unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName),
                  unicode ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass),
                  cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
                  cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams);
            break;
        }
2458 2459 2460 2461
        case WM_SIZE:
            if (!enter) break;
            TRACE("cx=%d cy=%d\n", LOWORD(sp_e->lParam), HIWORD(sp_e->lParam));
            break;
2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476
        case WM_WINDOWPOSCHANGED:
            if (!enter) break;
        case WM_WINDOWPOSCHANGING:
            {
                WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam;
                TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
                      lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y,
                      lpwp->cx, lpwp->cy, lpwp->flags);
            }
            break;
        case WM_STYLECHANGED:
            if (!enter) break;
        case WM_STYLECHANGING:
            {
                LPSTYLESTRUCT ss = (LPSTYLESTRUCT) sp_e->lParam;
2477
                TRACE("STYLESTRUCT: StyleOld=0x%08x, StyleNew=0x%08x\n",
2478 2479 2480 2481
                      ss->styleOld, ss->styleNew);
            }
            break;
        case WM_NCCALCSIZE:
2482
            if (!sp_e->wParam)
2483 2484
            {
                RECT *rc = (RECT *)sp_e->lParam;
2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495
                TRACE("Rect %s\n", wine_dbgstr_rect(rc));
            }
            else
            {
                NCCALCSIZE_PARAMS *nc = (NCCALCSIZE_PARAMS *)sp_e->lParam;
                TRACE("Rects %s %s %s\n", wine_dbgstr_rect(nc->rgrc),
                      wine_dbgstr_rect(nc->rgrc + 1), wine_dbgstr_rect(nc->rgrc + 2));
                if (nc->lppos)
                    TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
                          nc->lppos->hwnd, nc->lppos->hwndInsertAfter, nc->lppos->x, nc->lppos->y,
                          nc->lppos->cx, nc->lppos->cy, nc->lppos->flags);
2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506
            }
            break;
        case WM_NOTIFY:
            /* if (!enter) break; */
            {
                NMHDR * pnmh = (NMHDR*) sp_e->lParam;
                UINT *q, dumplen;
                const SPY_NOTIFY *p;
                WCHAR from_class[60];
                DWORD save_error;

2507
                p = SPY_Bsearch_Notify( pnmh->code );
2508
                if (p) {
2509
                    TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=%s<0x%08x>, extra=0x%x\n",
2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521
                          pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len);
                    dumplen = p->len;

                    /* for CUSTOMDRAW, dump all the data for TOOLBARs */
                    if (pnmh->code == NM_CUSTOMDRAW) {
                        /* save and restore error code over the next call */
                        save_error = GetLastError();
                        GetClassNameW(pnmh->hwndFrom, from_class,
                                      sizeof(from_class)/sizeof(WCHAR));
                        SetLastError(save_error);
                        if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0)
                            dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR);
2522 2523
                    } else if ( pnmh->code >= HDN_ENDDRAG
                                && pnmh->code <= HDN_ITEMCHANGINGA ) {
2524 2525 2526 2527 2528 2529 2530 2531
                        dumplen = sizeof(NMHEADERA)-sizeof(NMHDR);
                    }
                    if (dumplen > 0) {
                        q = (UINT *)(pnmh + 1);
                        SPY_DumpMem ("NM extra", q, (INT)dumplen);
                    }
                }
                else
2532
                    TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=0x%08x\n",
2533 2534
                          pnmh->hwndFrom, pnmh->idFrom, pnmh->code);
            }
2535
            break;
2536 2537 2538 2539
        default:
            if (sp_e->data_len > 0)
                SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len);
        }
2540

2541
}
2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605


/***********************************************************************
 *           spy_init
 */
static BOOL spy_init(void)
{
    int i;
    char buffer[1024];
    HKEY hkey;
    char *exclude;

    if (!TRACE_ON(message)) return FALSE;

    if (indent_tls_index == TLS_OUT_OF_INDEXES)
    {
        DWORD index = TlsAlloc();
        if (InterlockedCompareExchange( &indent_tls_index, index, TLS_OUT_OF_INDEXES ) != TLS_OUT_OF_INDEXES)
            TlsFree( index );
    }

    if (spy_exclude) return TRUE;
    exclude = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, SPY_MAX_MSGNUM + 2 );

    /* @@ Wine registry key: HKCU\Software\Wine\Debug */
    if(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Debug", &hkey))
    {
        DWORD type, count = sizeof(buffer);

        buffer[0] = 0;
        if (!RegQueryValueExA(hkey, "SpyInclude", 0, &type, (LPBYTE) buffer, &count) &&
            strcmp( buffer, "INCLUDEALL" ))
        {
            TRACE("Include=%s\n", buffer );
            for (i = 0; i <= SPY_MAX_MSGNUM; i++)
                exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
        }

        count = sizeof(buffer);
        buffer[0] = 0;
        if (!RegQueryValueExA(hkey, "SpyExclude", 0, &type, (LPBYTE) buffer, &count))
        {
            TRACE("Exclude=%s\n", buffer );
            if (!strcmp( buffer, "EXCLUDEALL" ))
                for (i = 0; i <= SPY_MAX_MSGNUM; i++) exclude[i] = TRUE;
            else
                for (i = 0; i <= SPY_MAX_MSGNUM; i++)
                    exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i]));
        }

        count = sizeof(buffer);
        if(!RegQueryValueExA(hkey, "SpyExcludeDWP", 0, &type, (LPBYTE) buffer, &count))
            exclude[SPY_MAX_MSGNUM + 1] = atoi(buffer);

        RegCloseKey(hkey);
    }

    if (InterlockedCompareExchangePointer( (void **)&spy_exclude, exclude, NULL ))
        HeapFree( GetProcessHeap(), 0, exclude );

    return TRUE;
}


Alexandre Julliard's avatar
Alexandre Julliard committed
2606 2607
/***********************************************************************
 *           SPY_EnterMessage
Alexandre Julliard's avatar
Alexandre Julliard committed
2608
 */
2609 2610
void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
                       WPARAM wParam, LPARAM lParam )
Alexandre Julliard's avatar
Alexandre Julliard committed
2611
{
2612
    SPY_INSTANCE sp_e;
2613
    int indent;
2614
    DWORD save_error = GetLastError();
Alexandre Julliard's avatar
Alexandre Julliard committed
2615

2616
    if (!spy_init() || exclude_msg(msg)) return;
Alexandre Julliard's avatar
Alexandre Julliard committed
2617

2618
    sp_e.msgnum = msg;
2619
    sp_e.msg_hwnd = hWnd;
2620 2621 2622 2623
    sp_e.lParam = lParam;
    sp_e.wParam = wParam;
    SPY_GetWndName(&sp_e);
    SPY_GetMsgStuff(&sp_e);
2624
    indent = get_indent_level();
2625

Alexandre Julliard's avatar
Alexandre Julliard committed
2626
    /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
Alexandre Julliard's avatar
Alexandre Julliard committed
2627
    switch(iFlag)
Alexandre Julliard's avatar
Alexandre Julliard committed
2628
    {
2629
    case SPY_DISPATCHMESSAGE:
2630
        TRACE("%*s(%p) %-16s [%04x] %s dispatched  wp=%08lx lp=%08lx\n",
2631
                        indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2632
                        sp_e.msg_name, wParam, lParam);
Alexandre Julliard's avatar
Alexandre Julliard committed
2633 2634
        break;

2635
    case SPY_SENDMESSAGE:
Alexandre Julliard's avatar
Alexandre Julliard committed
2636
        {
2637 2638
            char taskName[20];
            DWORD tid = GetWindowThreadProcessId( hWnd, NULL );
Alexandre Julliard's avatar
Alexandre Julliard committed
2639

2640
            if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
2641
            else sprintf( taskName, "tid %04x", GetCurrentThreadId() );
Alexandre Julliard's avatar
Alexandre Julliard committed
2642

2643 2644 2645 2646
            TRACE("%*s(%p) %-16s [%04x] %s sent from %s wp=%08lx lp=%08lx\n",
                  indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
                  sp_e.msg_name, taskName, wParam, lParam );
            SPY_DumpStructure(&sp_e, TRUE);
Alexandre Julliard's avatar
Alexandre Julliard committed
2647
        }
2648
        break;
Alexandre Julliard's avatar
Alexandre Julliard committed
2649

2650
    case SPY_DEFWNDPROC:
2651
        if (exclude_dwp()) return;
2652 2653
        TRACE("%*s(%p)  DefWindowProc:[%04x] %s  wp=%08lx lp=%08lx\n",
              indent, "", hWnd, msg, sp_e.msg_name, wParam, lParam );
Alexandre Julliard's avatar
Alexandre Julliard committed
2654
        break;
2655 2656
    }
    set_indent_level( indent + SPY_INDENT_UNIT );
2657
    SetLastError( save_error );
Alexandre Julliard's avatar
Alexandre Julliard committed
2658
}
Alexandre Julliard's avatar
Alexandre Julliard committed
2659

Alexandre Julliard's avatar
Alexandre Julliard committed
2660 2661 2662 2663

/***********************************************************************
 *           SPY_ExitMessage
 */
2664 2665
void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
                       WPARAM wParam, LPARAM lParam )
Alexandre Julliard's avatar
Alexandre Julliard committed
2666
{
2667
    SPY_INSTANCE sp_e;
2668
    int indent;
2669
    DWORD save_error = GetLastError();
Alexandre Julliard's avatar
Alexandre Julliard committed
2670

2671 2672
    if (!TRACE_ON(message) || exclude_msg(msg) ||
        (exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
2673
        return;
Alexandre Julliard's avatar
Alexandre Julliard committed
2674

2675 2676 2677 2678 2679 2680 2681
    sp_e.msgnum = msg;
    sp_e.msg_hwnd   = hWnd;
    sp_e.lParam = lParam;
    sp_e.wParam = wParam;
    SPY_GetWndName(&sp_e);
    SPY_GetMsgStuff(&sp_e);

2682 2683 2684 2685 2686
    if ((indent = get_indent_level()))
    {
        indent -= SPY_INDENT_UNIT;
        set_indent_level( indent );
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
2687 2688

    switch(iFlag)
Alexandre Julliard's avatar
Alexandre Julliard committed
2689
    {
2690
    case SPY_RESULT_DEFWND:
2691 2692
        TRACE(" %*s(%p)  DefWindowProc: [%04x] %s returned %08lx\n",
              indent, "", hWnd, msg, sp_e.msg_name, lReturn );
Alexandre Julliard's avatar
Alexandre Julliard committed
2693
        break;
Alexandre Julliard's avatar
Alexandre Julliard committed
2694

2695
    case SPY_RESULT_OK:
2696
        TRACE(" %*s(%p) %-16s [%04x] %s returned %08lx\n",
2697
                        indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2698
                        sp_e.msg_name, lReturn );
2699
        SPY_DumpStructure(&sp_e, FALSE);
2700
        break;
2701 2702
    }
    SetLastError( save_error );
Alexandre Julliard's avatar
Alexandre Julliard committed
2703
}