spy.c 90.8 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 42
#define SPY_MAX_MSGNUM   WM_USER
#define SPY_INDENT_UNIT  4  /* 4 spaces */

43 44
#define DEBUG_SPY 0

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

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

Alexandre Julliard's avatar
Alexandre Julliard committed
140 141
    /* 0x0050 */
    "WM_INPUTLANGCHANGEREQUEST",
142 143 144 145 146
    "WM_INPUTLANGCHANGE",
    "WM_TCARD",
    "WM_HELP",
    "WM_USERCHANGED",
    "WM_NOTIFYFORMAT", NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
147 148 149 150 151 152 153 154
    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,
155 156 157 158 159
    NULL, NULL, NULL,
    "WM_CONTEXTMENU",
    "WM_STYLECHANGING",
    "WM_STYLECHANGED",
    "WM_DISPLAYCHANGE",
Alexandre Julliard's avatar
Alexandre Julliard committed
160
    "WM_GETICON",
Alexandre Julliard's avatar
Alexandre Julliard committed
161

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

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

    /* 0x00A0 */
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
    "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
194

Alexandre Julliard's avatar
Alexandre Julliard committed
195
    /* 0x00B0 - Win32 Edit controls */
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
    "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
211
    NULL,                       /* 0x00bf */
Alexandre Julliard's avatar
Alexandre Julliard committed
212

Alexandre Julliard's avatar
Alexandre Julliard committed
213
    NULL,                       /* 0x00c0 */
214 215
    "EM_LINELENGTH",            /* 0x00c1 */
    "EM_REPLACESEL",            /* 0x00c2 */
Alexandre Julliard's avatar
Alexandre Julliard committed
216
    NULL,                       /* 0x00c3 */
217 218 219 220 221 222
    "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
223
    NULL,                       /* 0x00ca */
224 225 226 227 228
    "EM_SETTABSTOPS",           /* 0x00cb */
    "EM_SETPASSWORDCHAR",       /* 0x00cc */
    "EM_EMPTYUNDOBUFFER",       /* 0x00cd */
    "EM_GETFIRSTVISIBLELINE",   /* 0x00ce */
    "EM_SETREADONLY",           /* 0x00cf */
Alexandre Julliard's avatar
Alexandre Julliard committed
229

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

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

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

268 269 270 271 272 273 274 275
    "WM_KEYDOWN",               /* 0x0100 */
    "WM_KEYUP",                 /* 0x0101 */
    "WM_CHAR",                  /* 0x0102 */
    "WM_DEADCHAR",              /* 0x0103 */
    "WM_SYSKEYDOWN",            /* 0x0104 */
    "WM_SYSKEYUP",              /* 0x0105 */
    "WM_SYSCHAR",               /* 0x0106 */
    "WM_SYSDEADCHAR",           /* 0x0107 */
276
    NULL,
277 278 279 280
    "WM_UNICHAR",               /* 0x0109 */
    "WM_CONVERTREQUEST",        /* 0x010a */
    "WM_CONVERTRESULT",         /* 0x010b */
    "WM_INTERIM",               /* 0x010c */
281 282 283 284 285 286 287 288 289 290
    "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
291 292
    "WM_INITMENU",              /* 0x0116 */
    "WM_INITMENUPOPUP",         /* 0x0117 */
293
    "WM_SYSTIMER",              /* 0x0118 */
Alexandre Julliard's avatar
Alexandre Julliard committed
294 295
    NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_MENUSELECT",            /* 0x011f */
Alexandre Julliard's avatar
Alexandre Julliard committed
296

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

    "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
309
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
310 311

    /* 0x0130 */
Alexandre Julliard's avatar
Alexandre Julliard committed
312
    NULL,
313
    "WM_LBTRACKPOINT",          /* 0x0131 */
Alexandre Julliard's avatar
Alexandre Julliard committed
314 315 316 317 318 319 320 321
    "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
322

Alexandre Julliard's avatar
Alexandre Julliard committed
323
    /* 0x0140 - Win32 Comboboxes */
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
    "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
340

341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
    "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
357

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

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

Alexandre Julliard's avatar
Alexandre Julliard committed
371
    /* 0x0180 - Win32 Listboxes */
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
    "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
388

389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
    "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
405

406 407 408 409 410 411 412 413 414 415
    "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
416
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
417 418

    /* 0x01B0 */
419 420 421
    NULL, NULL,
    "LB_GETLISTBOXINFO",         /* 0x01b2 */
    NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
422 423 424 425 426 427 428 429 430 431 432
    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 */
433 434 435
    NULL,
    "MN_GETHMENU",              /* 0x01E1 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
436 437 438 439 440 441
    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,

442 443 444 445 446 447 448 449 450 451
    "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 */
452
    "WM_MOUSEWHEEL",            /* 0x020A */
453 454 455
    "WM_XBUTTONDOWN",           /* 0x020B */
    "WM_XBUTTONUP",             /* 0x020C */
    "WM_XBUTTONDBLCLK",         /* 0x020D */
456 457
    "WM_MOUSEHWHEEL",           /* 0x020E */
    NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
458

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

    "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 */

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

Alexandre Julliard's avatar
Alexandre Julliard committed
487
    /* 0x0230*/
Alexandre Julliard's avatar
Alexandre Julliard committed
488
    "WM_MDISETMENU",            /* 0x0230 */
489 490 491
    "WM_ENTERSIZEMOVE",         /* 0x0231 */
    "WM_EXITSIZEMOVE",          /* 0x0232 */
    "WM_DROPFILES",             /* 0x0233 */
492 493 494 495 496 497
    "WM_MDIREFRESHMENU",        /* 0x0234 */
    NULL, NULL, NULL,
    "WM_POINTERDEVICECHANGE",   /* 0x0238 */
    "WM_POINTERDEVICEINRANGE",  /* 0x0239 */
    "WM_POINTERDEVICEOUTOFRANGE", /* 0x023a */
    NULL, NULL, NULL, NULL, NULL,
498

Alexandre Julliard's avatar
Alexandre Julliard committed
499
    /* 0x0240 */
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
    "WM_TOUCH",                 /* 0x0240 */
    "WM_NCPOINTERUPDATE",       /* 0x0241 */
    "WM_NCPOINTERDOWN",         /* 0x0242 */
    "WM_NCPOINTERUP",           /* 0x0243 */
    NULL,
    "WM_POINTERUPDATE",         /* 0x0245 */
    "WM_POINTERDOWN",           /* 0x0246 */
    "WM_POINTERUP",             /* 0x0247 */
    NULL,
    "WM_POINTERENTER",          /* 0x0249 */
    "WM_POINTERLEAVE",          /* 0x024a */
    "WM_POINTERACTIVATE",       /* 0x024b */
    "WM_POINTERCAPTURECHANGED", /* 0x024c */
    "WM_TOUCHHITTESTING",       /* 0x024d */
    "WM_POINTERWHEEL",          /* 0x024e */
    "WM_POINTERHWHEEL",         /* 0x024f */
Alexandre Julliard's avatar
Alexandre Julliard committed
516 517 518 519

    /* 0x0250 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
520

Alexandre Julliard's avatar
Alexandre Julliard committed
521 522 523 524 525 526 527
    /* 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 */
528 529 530 531 532 533 534 535 536 537 538 539 540
    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
541 542
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

543
    /* 0x02a0 */
544 545 546 547 548 549 550
    "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
551
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
552
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
553 554

    /* 0x02c0 */
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
    "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
587

588 589 590 591 592 593 594
    "WM_DPICHANGED",            /* 0x02e0 */
    NULL,
    "WM_DPICHANGED_BEFOREPARENT",/* 0x02e2 */
    "WM_DPICHANGED_AFTERPARENT",/* 0x02e3 */
    "WM_GETDPISCALEDSIZE",      /* 0x02e4 */
    NULL, NULL, NULL,

Alexandre Julliard's avatar
Alexandre Julliard committed
595 596 597 598
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

599
    "WM_CUT",                   /* 0x0300 */
600 601 602 603 604 605
    "WM_COPY",
    "WM_PASTE",
    "WM_CLEAR",
    "WM_UNDO",
    "WM_RENDERFORMAT",
    "WM_RENDERALLFORMATS",
Alexandre Julliard's avatar
Alexandre Julliard committed
606
    "WM_DESTROYCLIPBOARD",
607 608 609 610 611
    "WM_DRAWCLIPBOARD",
    "WM_PAINTCLIPBOARD",
    "WM_VSCROLLCLIPBOARD",
    "WM_SIZECLIPBOARD",
    "WM_ASKCBFORMATNAME",
Alexandre Julliard's avatar
Alexandre Julliard committed
612 613
    "WM_CHANGECBCHAIN",
    "WM_HSCROLLCLIPBOARD",
614
    "WM_QUERYNEWPALETTE",       /* 0x030f*/
Alexandre Julliard's avatar
Alexandre Julliard committed
615 616

    "WM_PALETTEISCHANGING",
Alexandre Julliard's avatar
Alexandre Julliard committed
617
    "WM_PALETTECHANGED",
618
    "WM_HOTKEY",                /* 0x0312 */
619 620
    "WM_POPUPSYSTEMMENU",       /* 0x0313 */
    NULL, NULL, NULL,
621 622 623 624
    "WM_PRINT",                 /* 0x0317 */
    "WM_PRINTCLIENT",           /* 0x0318 */
    "WM_APPCOMMAND",            /* 0x0319 */
    "WM_THEMECHANGED",          /* 0x031A */
625 626 627 628
    NULL, NULL,
    "WM_CLIPBOARDUPDATE",       /* 0x031D */
    "WM_DWMCOMPOSITIONCHANGED", /* 0x031E */
    "WM_DWMNCRENDERINGCHANGED", /* 0x031F */
Alexandre Julliard's avatar
Alexandre Julliard committed
629

630 631 632
    "WM_DWMCOLORIZATIONCOLORCHANGED", /* 0x0320 */
    "WM_DWMWINDOWMAXIMIZEDCHANGE", /* 0x0321 */
    NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
633
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
634

Alexandre Julliard's avatar
Alexandre Julliard committed
635
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
636 637
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    "WM_GETTITLEBARINFOEX",     /* 0x033F */
Alexandre Julliard's avatar
Alexandre Julliard committed
638 639 640 641

    /* 0x0340 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
642
    /* 0x0350 */
Alexandre Julliard's avatar
Alexandre Julliard committed
643
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
644 645 646 647 648 649 650 651
    "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
652

653
    "WM_QUERYAFXWNDPROC",   /*  0x0360 WM_AFXFIRST */
Alexandre Julliard's avatar
Alexandre Julliard committed
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
    "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 */

680 681
    NULL,NULL,NULL,
    "WM_AFXLAST",               /* 0x037F */
Alexandre Julliard's avatar
Alexandre Julliard committed
682

683 684 685 686 687 688 689 690 691 692 693 694 695 696
    "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 */
697

Alexandre Julliard's avatar
Alexandre Julliard committed
698
    /* 0x03a0 */
699 700 701 702
    "MM_JOY1MOVE",
    "MM_JOY2MOVE",
    "MM_JOY1ZMOVE",
    "MM_JOY2ZMOVE",
Alexandre Julliard's avatar
Alexandre Julliard committed
703 704 705 706
                            NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x03b0 */
707 708 709
    NULL, NULL, NULL, NULL, NULL,
    "MM_JOY1BUTTONDOWN",
    "MM_JOY2BUTTONDOWN",
Alexandre Julliard's avatar
Alexandre Julliard committed
710 711
    "MM_JOY1BUTTONUP",
    "MM_JOY2BUTTONUP",
712
    "MM_MCINOTIFY",       /* 0x03B9 */
713
                NULL,
714 715 716 717 718
    "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
719 720

    /* 0x03c0 */
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
    "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
739
                NULL, NULL, NULL, NULL, NULL, NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
740 741 742 743
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    /* 0x03e0 */
    "WM_DDE_INITIATE",  /* 0x3E0 */
744 745 746 747 748 749 750 751
    "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
752 753
    NULL, NULL, NULL, NULL, NULL, NULL, NULL,

754

Alexandre Julliard's avatar
Alexandre Julliard committed
755 756 757 758
    /* 0x03f0 */
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

759
    "WM_USER"                   /* 0x0400 */
Alexandre Julliard's avatar
Alexandre Julliard committed
760 761
};

Alexandre Julliard's avatar
Alexandre Julliard committed
762

763
#define SPY_MAX_LVMMSGNUM   182
764 765
static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] =
{
766
    "LVM_GETBKCOLOR",           /* 1000 */
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797
    "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",
798
    NULL,
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 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904
    "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",
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
    "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"
949 950
};

951 952 953 954

#define SPY_MAX_TVMSGNUM   65
static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] =
{
955
    "TVM_INSERTITEMA",          /* 1100 */
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 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
    "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] =
{
1027
    "HDM_GETITEMCOUNT",         /* 1200 */
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052
    "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] =
{
1053
    NULL,               /* 1300 */
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 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120
    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] =
{
1121
    NULL,               /* 1400 */
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
    "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"
};


1138
#define SPY_MAX_CCMMSGNUM   9
1139 1140
static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] =
{
1141
    NULL,               /* 0x2000 */
1142 1143 1144 1145 1146
    "CCM_SETBKCOLOR",
    "CCM_SETCOLORSCHEME",
    "CCM_GETCOLORSCHEME",
    "CCM_GETDROPTARGET",
    "CCM_SETUNICODEFORMAT",
1147 1148 1149 1150
    "CCM_GETUNICODEFORMAT",
    "CCM_SETVERSION",
    "CCM_GETVERSION",
    "CCM_SETNOTIFYWINDOW"
1151 1152
};

1153
#define SPY_MAX_WINEMSGNUM   (WM_WINE_MOUSE_LL_HOOK - WM_WINE_DESTROYWINDOW)
1154 1155 1156 1157 1158 1159 1160
static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] =
{
    "WM_WINE_DESTROYWINDOW",
    "WM_WINE_SETWINDOWPOS",
    "WM_WINE_SHOWWINDOW",
    "WM_WINE_SETPARENT",
    "WM_WINE_SETWINDOWLONG",
1161
    "WM_WINE_SETSTYLE",
1162 1163 1164
    "WM_WINE_SETACTIVEWINDOW",
    "WM_WINE_KEYBOARD_LL_HOOK",
    "WM_WINE_MOUSE_LL_HOOK",
1165 1166
};

1167 1168 1169 1170
/* Virtual key names */
#define SPY_MAX_VKKEYSNUM 255
static const char * const VK_KeyNames[SPY_MAX_VKKEYSNUM + 1] =
{
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198
    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 */
1199 1200 1201 1202
    "VK_CONVERT",       /* 0x1C */
    "VK_NONCONVERT",    /* 0x1D */
    "VK_ACCEPT",        /* 0x1E */
    "VK_MODECHANGE",    /* 0x1F */
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 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
    "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 */
1266
    "VK_SLEEP",         /* 0x5F */
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 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316
    "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 */
1317 1318 1319 1320 1321
    "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 */
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336
    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 */
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354
    "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 */
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 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401
    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 */
1402
    "VK_PACKET",        /* 0xE7 */
1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
    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 */
1427 1428
};

1429

1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444
/************************************************************************/


/* 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
{
1445 1446 1447
    const WCHAR      *classname;  /* class name to match */
    const USER_MSG   *classmsg;   /* pointer to first USER_MSG for class */
    UINT              count;      /* number of entries */
1448 1449
} CONTROL_CLASS;

1450 1451 1452 1453 1454
#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      */
1455
/* number. (First method preferred.)                         */
1456

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

1459
static const USER_MSG rebar_array[] = {
1460 1461 1462 1463
          USM(RB_INSERTBANDA,          0),
          USM(RB_DELETEBAND,           0),
          USM(RB_GETBARINFO,           0),
          USM(RB_SETBARINFO,           0),
1464
          USM(RB_GETBANDINFO_OLD,      0),
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494
          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),
1495
};
1496 1497 1498 1499 1500 1501 1502

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),
1503
          USM(TB_MARKBUTTON            ,0),
1504 1505 1506
          USM(TB_ISBUTTONENABLED       ,0),
          USM(TB_ISBUTTONCHECKED       ,0),
          USM(TB_ISBUTTONPRESSED       ,0),
1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520
          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),
1521
          USM(TB_ADDSTRINGA            ,0),
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567
          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),
1568
          USM(TB_ADDSTRINGW            ,0),
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581
          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),
1582 1583
          USM(TB_GETSTRINGW            ,0),
          USM(TB_GETSTRINGA            ,0),
1584
          USM(TB_SETBOUNDINGSIZE       ,8),
1585
          USM(TB_SETHOTITEM2           ,0),
1586
          USM(TB_HASACCELERATOR        ,0),
1587 1588 1589
          USM(TB_SETLISTGAP            ,0),
          USM(TB_GETIMAGELISTCOUNT     ,0),
          USM(TB_GETIDEALSIZE          ,8),
1590
          USM(TB_UNKWN464              ,0),
1591
};
1592

1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620
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),
1621
          USM(TTM_GETBUBBLESIZE        ,0),
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631
          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),
1632
};
1633

1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648
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),
1649
};
1650

Guy Albertelli's avatar
Guy Albertelli committed
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671
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),
1672
};
1673
static const WCHAR PropSheetInfoStr[] =
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690
    {'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),
1691
};
Guy Albertelli's avatar
Guy Albertelli committed
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 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773
/* 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),
1774
};
1775

1776
#undef SZOF
1777 1778
#undef USM

1779
static const CONTROL_CLASS cc_array[] = {
1780 1781 1782 1783 1784 1785 1786 1787 1788
    {WC_COMBOBOXEXW,    comboex_array,  ARRAY_SIZE(comboex_array)},
    {WC_PROPSHEETW,     propsht_array,  ARRAY_SIZE(propsht_array)},
    {REBARCLASSNAMEW,   rebar_array,    ARRAY_SIZE(rebar_array)},
    {TOOLBARCLASSNAMEW, toolbar_array,  ARRAY_SIZE(toolbar_array)},
    {TOOLTIPS_CLASSW,   tooltips_array, ARRAY_SIZE(tooltips_array)},
    {UPDOWN_CLASSW,     updown_array,   ARRAY_SIZE(updown_array)},
    {RICHEDIT_CLASS20W, richedit_array, ARRAY_SIZE(richedit_array)},
    {0, 0, 0}
};
1789 1790 1791 1792 1793


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


1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810
/* 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  */
1811 1812
    SPNFY(NM_OUTOFMEMORY,        NMHDR),
    SPNFY(NM_CLICK,              NMHDR),
1813
    SPNFY(NM_DBLCLK,             NMHDR),
1814
    SPNFY(NM_RETURN,             NMHDR),
1815
    SPNFY(NM_RCLICK,             NMHDR),
1816
    SPNFY(NM_RDBLCLK,            NMHDR),
1817 1818 1819 1820
    SPNFY(NM_SETFOCUS,           NMHDR),
    SPNFY(NM_KILLFOCUS,          NMHDR),
    SPNFY(NM_CUSTOMDRAW,         NMCUSTOMDRAW),
    SPNFY(NM_HOVER,              NMHDR),
1821
    SPNFY(NM_NCHITTEST,          NMMOUSE),
1822 1823 1824 1825
    SPNFY(NM_KEYDOWN,            NMKEY),
    SPNFY(NM_RELEASEDCAPTURE,    NMHDR),
    SPNFY(NM_SETCURSOR,          NMMOUSE),
    SPNFY(NM_CHAR,               NMCHAR),
1826
    SPNFY(NM_TOOLTIPSCREATED,    NMTOOLTIPSCREATED),
1827
    /* Listview       0U-100U  to  0U-199U  */
1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843
    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),
1844
    SPNFY(LVN_ODFINDITEMA,       NMLVFINDITEMA),
1845 1846 1847 1848 1849 1850 1851 1852
    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),
1853
    SPNFY(LVN_ODFINDITEMW,       NMLVFINDITEMW),
Guy Albertelli's avatar
Guy Albertelli committed
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864
    /* 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),
1865 1866
    SPNFY(PSN_TRANSLATEACCELERATOR, PSHNOTIFY),
    SPNFY(PSN_QUERYINITIALFOCUS, PSHNOTIFY),
1867
    /* Header         0U-300U  to  0U-399U  */
1868 1869 1870 1871 1872 1873 1874 1875 1876
    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),
1877 1878 1879 1880 1881 1882 1883 1884 1885
    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),
1886
    SPNFY(HDN_TRACKW,            NMHDR),
1887
    SPNFY(HDN_GETDISPINFOW,      NMHDR),
1888
    /* Treeview       0U-400U  to  0U-499U  */
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911
    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),
1912
    /* Tooltips       0U-520U  to  0U-549U  */
1913 1914 1915 1916
    SPNFY(TTN_GETDISPINFOA,      NMHDR),
    SPNFY(TTN_SHOW,              NMHDR),
    SPNFY(TTN_POP,               NMHDR),
    SPNFY(TTN_GETDISPINFOW,      NMHDR),
1917
    /* Tab            0U-550U  to  0U-580U  */
1918 1919 1920 1921
    SPNFY(TCN_KEYDOWN,           NMHDR),
    SPNFY(TCN_SELCHANGE,         NMHDR),
    SPNFY(TCN_SELCHANGING,       NMHDR),
    SPNFY(TCN_GETOBJECT,         NMHDR),
1922
    /* Common Dialog  0U-601U  to  0U-699U  */
1923 1924 1925 1926 1927 1928 1929
    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),
1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942
    /* 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),
1943
    SPNFY(TBN_HOTITEMCHANGE,     NMTBHOTITEM),
1944 1945
    SPNFY(TBN_DRAGOUT,           NMTOOLBARA),
    SPNFY(TBN_DELETINGBUTTON,    NMTOOLBARA),
1946 1947
    SPNFY(TBN_GETDISPINFOA,      NMTBDISPINFOA),
    SPNFY(TBN_GETDISPINFOW,      NMTBDISPINFOW),
1948 1949 1950 1951
    SPNFY(TBN_GETINFOTIPA,       NMTBGETINFOTIPA),
    SPNFY(TBN_GETINFOTIPW,       NMTBGETINFOTIPW),
    SPNFY(TBN_GETBUTTONINFOW,    NMTOOLBARW),
    /* Up/Down        0U-721U  to  0U-740U  */
1952
    SPNFY(UDN_DELTAPOS,          NM_UPDOWN),
1953
    /* Month Calendar 0U-750U  to  0U-759U  */
1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968
    /* ******************* 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 ***************************** */
1969
    /* Date/Time      0U-760U  to  0U-799U  */
1970 1971 1972
    /* SPNFY(MCN_SELECT,            NMHDR), */
    /* SPNFY(MCN_GETDAYSTATE,       NMHDR), */
    /* SPNFY(MCN_SELCHANGE,         NMHDR), */
1973 1974 1975 1976 1977 1978 1979 1980
    /* ******************* 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 ***************************** */
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994
    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),
1995
    /* ComboBoxEx     0U-800U  to  0U-830U  */
1996 1997 1998
    SPNFY(CBEN_GETDISPINFOA,     NMCOMBOBOXEXA),
    SPNFY(CBEN_INSERTITEM,       NMCOMBOBOXEXA),
    SPNFY(CBEN_DELETEITEM,       NMCOMBOBOXEXA),
1999
    SPNFY(CBEN_BEGINEDIT,        NMHDR),
2000 2001
    SPNFY(CBEN_ENDEDITA,         NMCBEENDEDITA),
    SPNFY(CBEN_ENDEDITW,         NMCBEENDEDITW),
2002 2003 2004
    SPNFY(CBEN_GETDISPINFOW,     NMCOMBOBOXEXW),
    SPNFY(CBEN_DRAGBEGINA,       NMCBEDRAGBEGINA),
    SPNFY(CBEN_DRAGBEGINW,       NMCBEDRAGBEGINW),
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
    /* 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
2015
    /* IP address     0U-860U  to  0U-879U  */
2016
    SPNFY(IPN_FIELDCHANGED,      NMHDR),
2017
    /* Status bar     0U-880U  to  0U-899U  */
2018
    SPNFY(SBN_SIMPLEMODECHANGE,  NMHDR),
2019
    /* Pager          0U-900U  to  0U-950U  */
2020 2021
    SPNFY(PGN_SCROLL,            NMPGSCROLL),
    SPNFY(PGN_CALCSIZE,          NMPGCALCSIZE),
2022
};
2023 2024
#undef SPNFY

2025
static unsigned char *spy_exclude;
Alexandre Julliard's avatar
Alexandre Julliard committed
2026

2027 2028 2029 2030 2031 2032 2033 2034 2035
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
2036

2037 2038 2039 2040 2041 2042 2043 2044 2045

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)  */
2046 2047
    WCHAR      wnd_class[60];    /* window class name (full)           */
    WCHAR      wnd_name[16];     /* window name for message            */
2048 2049
} SPY_INSTANCE;

2050
static int indent_tls_index = TLS_OUT_OF_INDEXES;
2051 2052 2053 2054

/***********************************************************************
 *           get_indent_level
 */
2055
static inline INT_PTR get_indent_level(void)
2056
{
2057
    return (INT_PTR)TlsGetValue( indent_tls_index );
2058 2059 2060 2061 2062 2063
}


/***********************************************************************
 *           set_indent_level
 */
2064
static inline void set_indent_level( INT_PTR level )
2065 2066 2067 2068
{
    TlsSetValue( indent_tls_index, (void *)level );
}

2069

Alexandre Julliard's avatar
Alexandre Julliard committed
2070
/***********************************************************************
2071
 *           SPY_GetMsgInternal
Alexandre Julliard's avatar
Alexandre Julliard committed
2072
 */
2073
static const char *SPY_GetMsgInternal( UINT msg )
Alexandre Julliard's avatar
Alexandre Julliard committed
2074
{
Alexandre Julliard's avatar
Alexandre Julliard committed
2075 2076
    if (msg <= SPY_MAX_MSGNUM)
        return MessageTypeNames[msg];
2077 2078 2079 2080

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

2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092
    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];

2093 2094 2095
    if (msg >= CCM_FIRST && msg <= CCM_FIRST + SPY_MAX_CCMMSGNUM)
        return CCMMessageTypeNames[msg-CCM_FIRST];

2096 2097
    if (msg >= WM_WINE_DESTROYWINDOW && msg <= WM_WINE_DESTROYWINDOW + SPY_MAX_WINEMSGNUM)
        return WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW];
2098 2099

    return NULL;
Alexandre Julliard's avatar
Alexandre Julliard committed
2100 2101
}

Alexandre Julliard's avatar
Alexandre Julliard committed
2102
/***********************************************************************
2103 2104
 *           SPY_Bsearch_Msg
 */
2105
static const USER_MSG *SPY_Bsearch_Msg( const USER_MSG *msgs, UINT count, UINT code)
2106
{
2107
    int low = 0, high = count - 1;
2108

2109 2110 2111 2112 2113 2114
    while (low <= high)
    {
        int idx = (low + high) / 2;
        if (msgs[idx].value == code) return msgs + idx;
        if (msgs[idx].value > code)
            high = idx - 1;
2115
        else
2116
            low = idx + 1;
2117 2118 2119 2120
    }
    return NULL;
}

2121 2122 2123 2124 2125 2126 2127 2128 2129
/***********************************************************************
 *           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) <
2130
        ARRAY_SIZE(ClassLongOffsetNames)))
2131 2132 2133 2134 2135 2136 2137
    {
        return ClassLongOffsetNames[index];
    }

    return "?";
}

2138 2139 2140 2141 2142 2143 2144 2145
/***********************************************************************
 *           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   */
2146
    if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == WC_DIALOG) &&
2147 2148 2149 2150
        (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) {
        strcpyW(sp_e->wnd_class, WC_PROPSHEETW);
    }
    else {
2151
        GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, ARRAY_SIZE(sp_e->wnd_class));
2152 2153 2154
    }
}

2155 2156 2157 2158
/***********************************************************************
 *           SPY_GetMsgStuff
 *
 *  Get message name and other information for dumping
Alexandre Julliard's avatar
Alexandre Julliard committed
2159
 */
2160
static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
Alexandre Julliard's avatar
Alexandre Julliard committed
2161
{
2162
    const USER_MSG *p;
2163
    const char *msg_name = SPY_GetMsgInternal( sp_e->msgnum );
2164

2165
    sp_e->data_len = 0;
2166
    if (!msg_name)
2167
    {
2168
        INT i = 0;
2169

2170 2171 2172 2173 2174 2175 2176 2177 2178
        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;
            }
        }
2179 2180
        if (!sp_e->wnd_class[0]) SPY_GetClassName(sp_e);

2181
#if DEBUG_SPY
2182
        TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class));
2183
#endif
2184

2185 2186
        while (cc_array[i].classname &&
               strcmpiW(cc_array[i].classname, sp_e->wnd_class) != 0) i++;
2187

2188
        if (cc_array[i].classname)
2189
        {
2190
#if DEBUG_SPY
2191 2192 2193
            TRACE("process class %s, first %p, last %p\n",
                  debugstr_w(cc_array[i].classname), cc_array[i].classmsg,
                  cc_array[i].lastmsg);
2194
#endif
2195
            p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].count, sp_e->msgnum);
2196
            if (p) {
2197
                lstrcpynA (sp_e->msg_name, p->name, sizeof(sp_e->msg_name));
2198 2199 2200 2201
                sp_e->data_len = p->len;
                return;
            }
        }
2202 2203 2204 2205
        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 );
2206 2207 2208
    }
    else
    {
2209
        lstrcpynA(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name));
2210 2211 2212 2213 2214 2215
    }
}

/***********************************************************************
 *           SPY_GetWndName
 *
2216
 *  Sets the value of "wnd_name" and "wnd_class" members of the
2217 2218 2219
 *  instance structure.
 *
 */
2220
static void SPY_GetWndName( SPY_INSTANCE *sp_e )
2221
{
2222
    INT len;
2223

2224
    SPY_GetClassName( sp_e );
2225

2226
    len = InternalGetWindowText(sp_e->msg_hwnd, sp_e->wnd_name, ARRAY_SIZE(sp_e->wnd_name));
2227
    if(!len) /* get class name */
2228
    {
2229 2230
        LPWSTR dst = sp_e->wnd_name;
        LPWSTR src = sp_e->wnd_class;
2231
        int n = ARRAY_SIZE(sp_e->wnd_name) - 3;
2232 2233 2234 2235
        *dst++ = '{';
        while ((n-- > 0) && *src) *dst++ = *src++;
        *dst++ = '}';
        *dst = 0;
2236
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
2237
}
2238

2239 2240 2241
/***********************************************************************
 *           SPY_GetMsgName
 *
2242
 *  ****  External function  ****
2243 2244 2245 2246 2247
 *
 *  Get message name
 */
const char *SPY_GetMsgName( UINT msg, HWND hWnd )
{
2248
    SPY_INSTANCE ext_sp_e;
2249
    DWORD save_error = GetLastError();
2250

2251 2252 2253 2254
    ext_sp_e.msgnum = msg;
    ext_sp_e.msg_hwnd   = hWnd;
    ext_sp_e.lParam = 0;
    ext_sp_e.wParam = 0;
2255
    ext_sp_e.wnd_class[0] = 0;
2256
    SPY_GetMsgStuff(&ext_sp_e);
2257
    SetLastError( save_error );
2258
    return wine_dbg_sprintf("%s", ext_sp_e.msg_name);
2259 2260
}

2261 2262 2263 2264 2265 2266 2267 2268
/***********************************************************************
 *           SPY_GetVKeyName
 */
const char *SPY_GetVKeyName(WPARAM wParam)
{
    const char *vk_key_name;

    if(wParam <= SPY_MAX_VKKEYSNUM && VK_KeyNames[wParam])
2269
        vk_key_name = VK_KeyNames[wParam];
2270
    else
2271
        vk_key_name = "VK_???";
2272 2273 2274 2275

    return vk_key_name;
}

2276 2277 2278
/***********************************************************************
 *           SPY_Bsearch_Notify
 */
2279
static const SPY_NOTIFY *SPY_Bsearch_Notify( UINT code)
2280
{
2281
    int low = 0, high = ARRAY_SIZE(spnfy_array) - 1;
2282

2283 2284 2285 2286 2287 2288
    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;
2289
        else
2290
            low = idx + 1;
2291 2292 2293 2294
    }
    return NULL;
}

2295 2296 2297
/***********************************************************************
 *           SPY_DumpMem
 */
2298
static void SPY_DumpMem (LPCSTR header, const UINT *q, INT len)
2299 2300 2301 2302
{
    int i;

    for(i=0; i<len-12; i+=16) {
2303 2304 2305
        TRACE("%s [%04x] %08x %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2), *(q+3));
        q += 4;
2306
    }
2307 2308
    switch ((len - i + 3) & (~3)) {
    case 16:
2309 2310 2311
        TRACE("%s [%04x] %08x %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2), *(q+3));
        break;
2312
    case 12:
2313 2314 2315
        TRACE("%s [%04x] %08x %08x %08x\n",
              header, i, *q, *(q+1), *(q+2));
        break;
2316
    case 8:
2317 2318 2319
        TRACE("%s [%04x] %08x %08x\n",
              header, i, *q, *(q+1));
        break;
2320
    case 4:
2321 2322 2323
        TRACE("%s [%04x] %08x\n",
              header, i, *q);
        break;
2324
    default:
2325
        break;
2326 2327 2328
    }
}

2329 2330 2331
/***********************************************************************
 *           SPY_DumpStructure
 */
2332
static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
2333
{
2334
    switch (sp_e->msgnum)
2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367
        {
        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;
2368 2369
                if (rc)
                    TRACE("lParam rect (%s)\n", wine_dbgstr_rect(rc));
2370 2371 2372 2373 2374 2375 2376 2377 2378 2379
                break;
            }
        case LVM_SETITEMPOSITION32:
            if (!enter) break;
            /* fall through */
        case LVM_GETITEMPOSITION:
        case LVM_GETORIGIN:
            {
                LPPOINT point = (LPPOINT) sp_e->lParam;
                if (point) {
2380
                    TRACE("lParam point x=%d, y=%d\n", point->x, point->y);
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405
                }
                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;
2406
                TRACE("CHARRANGE: cpMin=%d cpMax=%d\n", cr->cpMin, cr->cpMax);
2407 2408 2409 2410 2411 2412
            }
            break;
        case EM_SETCHARFORMAT:
            if (enter && sp_e->lParam)
            {
                CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam;
2413
                TRACE("CHARFORMAT: dwMask=0x%08x dwEffects=", cf->dwMask);
2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427
                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)
2428
                    TRACE("yHeight=%d\n", cf->yHeight);
2429
                if (cf->dwMask & CFM_OFFSET)
2430
                    TRACE("yOffset=%d\n", cf->yOffset);
2431
                if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR))
2432
                    TRACE("crTextColor=%x\n", cf->crTextColor);
2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448
                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);
2449 2450 2451
                TRACE("hWnd=%p hDC=%p (%s) itemData=0x%08lx\n",
                      lpdis->hwndItem, lpdis->hDC,
                      wine_dbgstr_rect(&lpdis->rcItem), lpdis->itemData);
2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463
            }
            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;
2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480
        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;
        }
2481 2482 2483 2484
        case WM_SIZE:
            if (!enter) break;
            TRACE("cx=%d cy=%d\n", LOWORD(sp_e->lParam), HIWORD(sp_e->lParam));
            break;
2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499
        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;
2500
                TRACE("STYLESTRUCT: StyleOld=0x%08x, StyleNew=0x%08x\n",
2501 2502 2503 2504
                      ss->styleOld, ss->styleNew);
            }
            break;
        case WM_NCCALCSIZE:
2505
            if (!sp_e->wParam)
2506 2507
            {
                RECT *rc = (RECT *)sp_e->lParam;
2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518
                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);
2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529
            }
            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;

2530
                p = SPY_Bsearch_Notify( pnmh->code );
2531
                if (p) {
2532
                    TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=%s<0x%08x>, extra=0x%x\n",
2533 2534 2535 2536 2537 2538 2539
                          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();
2540
                        GetClassNameW(pnmh->hwndFrom, from_class, ARRAY_SIZE(from_class));
2541 2542 2543
                        SetLastError(save_error);
                        if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0)
                            dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR);
2544 2545
                    } else if ( pnmh->code >= HDN_ENDDRAG
                                && pnmh->code <= HDN_ITEMCHANGINGA ) {
2546 2547 2548 2549 2550 2551 2552 2553
                        dumplen = sizeof(NMHEADERA)-sizeof(NMHDR);
                    }
                    if (dumplen > 0) {
                        q = (UINT *)(pnmh + 1);
                        SPY_DumpMem ("NM extra", q, (INT)dumplen);
                    }
                }
                else
2554
                    TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=0x%08x\n",
2555 2556
                          pnmh->hwndFrom, pnmh->idFrom, pnmh->code);
            }
2557
            break;
2558 2559 2560 2561
        default:
            if (sp_e->data_len > 0)
                SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len);
        }
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 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627


/***********************************************************************
 *           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
2628 2629
/***********************************************************************
 *           SPY_EnterMessage
Alexandre Julliard's avatar
Alexandre Julliard committed
2630
 */
2631 2632
void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
                       WPARAM wParam, LPARAM lParam )
Alexandre Julliard's avatar
Alexandre Julliard committed
2633
{
2634
    SPY_INSTANCE sp_e;
2635
    int indent;
2636
    DWORD save_error = GetLastError();
Alexandre Julliard's avatar
Alexandre Julliard committed
2637

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

2640
    sp_e.msgnum = msg;
2641
    sp_e.msg_hwnd = hWnd;
2642 2643 2644 2645
    sp_e.lParam = lParam;
    sp_e.wParam = wParam;
    SPY_GetWndName(&sp_e);
    SPY_GetMsgStuff(&sp_e);
2646
    indent = get_indent_level();
2647

Alexandre Julliard's avatar
Alexandre Julliard committed
2648
    /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
Alexandre Julliard's avatar
Alexandre Julliard committed
2649
    switch(iFlag)
Alexandre Julliard's avatar
Alexandre Julliard committed
2650
    {
2651
    case SPY_DISPATCHMESSAGE:
2652
        TRACE("%*s(%p) %-16s [%04x] %s dispatched  wp=%08lx lp=%08lx\n",
2653
                        indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2654
                        sp_e.msg_name, wParam, lParam);
Alexandre Julliard's avatar
Alexandre Julliard committed
2655 2656
        break;

2657
    case SPY_SENDMESSAGE:
Alexandre Julliard's avatar
Alexandre Julliard committed
2658
        {
2659 2660
            char taskName[20];
            DWORD tid = GetWindowThreadProcessId( hWnd, NULL );
Alexandre Julliard's avatar
Alexandre Julliard committed
2661

2662
            if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
2663
            else sprintf( taskName, "tid %04x", GetCurrentThreadId() );
Alexandre Julliard's avatar
Alexandre Julliard committed
2664

2665 2666 2667 2668
            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
2669
        }
2670
        break;
Alexandre Julliard's avatar
Alexandre Julliard committed
2671

2672
    case SPY_DEFWNDPROC:
2673
        if (exclude_dwp()) return;
2674 2675
        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
2676
        break;
2677 2678
    }
    set_indent_level( indent + SPY_INDENT_UNIT );
2679
    SetLastError( save_error );
Alexandre Julliard's avatar
Alexandre Julliard committed
2680
}
Alexandre Julliard's avatar
Alexandre Julliard committed
2681

Alexandre Julliard's avatar
Alexandre Julliard committed
2682 2683 2684 2685

/***********************************************************************
 *           SPY_ExitMessage
 */
2686 2687
void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
                       WPARAM wParam, LPARAM lParam )
Alexandre Julliard's avatar
Alexandre Julliard committed
2688
{
2689
    SPY_INSTANCE sp_e;
2690
    int indent;
2691
    DWORD save_error = GetLastError();
Alexandre Julliard's avatar
Alexandre Julliard committed
2692

2693 2694
    if (!TRACE_ON(message) || exclude_msg(msg) ||
        (exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
2695
        return;
Alexandre Julliard's avatar
Alexandre Julliard committed
2696

2697 2698 2699 2700 2701 2702 2703
    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);

2704 2705 2706 2707 2708
    if ((indent = get_indent_level()))
    {
        indent -= SPY_INDENT_UNIT;
        set_indent_level( indent );
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
2709 2710

    switch(iFlag)
Alexandre Julliard's avatar
Alexandre Julliard committed
2711
    {
2712
    case SPY_RESULT_DEFWND:
2713 2714
        TRACE(" %*s(%p)  DefWindowProc: [%04x] %s returned %08lx\n",
              indent, "", hWnd, msg, sp_e.msg_name, lReturn );
Alexandre Julliard's avatar
Alexandre Julliard committed
2715
        break;
Alexandre Julliard's avatar
Alexandre Julliard committed
2716

2717
    case SPY_RESULT_OK:
2718
        TRACE(" %*s(%p) %-16s [%04x] %s returned %08lx\n",
2719
                        indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2720
                        sp_e.msg_name, lReturn );
2721
        SPY_DumpStructure(&sp_e, FALSE);
2722
        break;
2723 2724
    }
    SetLastError( save_error );
Alexandre Julliard's avatar
Alexandre Julliard committed
2725
}