2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
17 #define SPY_MAX_MSGNUM WM_USER
18 #define SPY_INDENT_UNIT 4 /* 4 spaces */
20 static const char * const MessageTypeNames
[SPY_MAX_MSGNUM
+ 1] =
38 "WM_CLOSE", /* 0x10 */
54 "WM_SETCURSOR", /* 0x20 */
70 "WM_SETFONT", /* 0x30 */
82 "wm_otherwindowcreated",
83 "wm_otherwindowdestroyed",
84 "wm_activateshellwindow",
88 "wm_compacting", NULL
, NULL
,
89 "WM_COMMNOTIFY", NULL
,
90 "WM_WINDOWPOSCHANGING", /* 0x0046 */
91 "WM_WINDOWPOSCHANGED", /* 0x0047 */
94 "WM_CANCELJOURNAL", NULL
, NULL
,
98 "WM_INPUTLANGCHANGEREQUEST",
103 "WM_NOTIFYFORMAT", NULL
, NULL
,
104 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
107 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
108 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
111 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
119 "WM_SETICON", /* 0x0080 */
120 "WM_NCCREATE", /* 0x0081 */
121 "WM_NCDESTROY", /* 0x0082 */
122 "WM_NCCALCSIZE", /* 0x0083 */
123 "WM_NCHITTEST", /* 0x0084 */
124 "WM_NCPAINT", /* 0x0085 */
125 "WM_NCACTIVATE", /* 0x0086 */
126 "WM_GETDLGCODE", /* 0x0087 */
128 "wm_synctask", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
131 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
132 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
135 "WM_NCMOUSEMOVE", /* 0x00A0 */
136 "WM_NCLBUTTONDOWN", /* 0x00A1 */
137 "WM_NCLBUTTONUP", /* 0x00A2 */
138 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
139 "WM_NCRBUTTONDOWN", /* 0x00A4 */
140 "WM_NCRBUTTONUP", /* 0x00A5 */
141 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
142 "WM_NCMBUTTONDOWN", /* 0x00A7 */
143 "WM_NCMBUTTONUP", /* 0x00A8 */
144 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
145 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
147 /* 0x00B0 - Win32 Edit controls */
148 "EM_GETSEL32", /* 0x00b0 */
149 "EM_SETSEL32", /* 0x00b1 */
150 "EM_GETRECT32", /* 0x00b2 */
151 "EM_SETRECT32", /* 0x00b3 */
152 "EM_SETRECTNP32", /* 0x00b4 */
153 "EM_SCROLL32", /* 0x00b5 */
154 "EM_LINESCROLL32", /* 0x00b6 */
155 "EM_SCROLLCARET32", /* 0x00b7 */
156 "EM_GETMODIFY32", /* 0x00b8 */
157 "EM_SETMODIFY32", /* 0x00b9 */
158 "EM_GETLINECOUNT32", /* 0x00ba */
159 "EM_LINEINDEX32", /* 0x00bb */
160 "EM_SETHANDLE32", /* 0x00bc */
161 "EM_GETHANDLE32", /* 0x00bd */
162 "EM_GETTHUMB32", /* 0x00be */
166 "EM_LINELENGTH32", /* 0x00c1 */
167 "EM_REPLACESEL32", /* 0x00c2 */
169 "EM_GETLINE32", /* 0x00c4 */
170 "EM_LIMITTEXT32", /* 0x00c5 */
171 "EM_CANUNDO32", /* 0x00c6 */
172 "EM_UNDO32", /* 0x00c7 */
173 "EM_FMTLINES32", /* 0x00c8 */
174 "EM_LINEFROMCHAR32", /* 0x00c9 */
176 "EM_SETTABSTOPS32", /* 0x00cb */
177 "EM_SETPASSWORDCHAR32", /* 0x00cc */
178 "EM_EMPTYUNDOBUFFER32", /* 0x00cd */
179 "EM_GETFIRSTVISIBLELINE32", /* 0x00ce */
180 "EM_SETREADONLY32", /* 0x00cf */
182 "EM_SETWORDBREAKPROC32", /* 0x00d0 */
183 "EM_GETWORDBREAKPROC32", /* 0x00d1 */
184 "EM_GETPASSWORDCHAR32", /* 0x00d2 */
185 "EM_SETMARGINS32", /* 0x00d3 */
186 "EM_GETMARGINS32", /* 0x00d4 */
187 "EM_GETLIMITTEXT32", /* 0x00d5 */
188 "EM_POSFROMCHAR32", /* 0x00d6 */
189 "EM_CHARFROMPOS32", /* 0x00d7 */
190 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
192 /* 0x00E0 - Win32 Scrollbars */
193 "SBM_SETPOS32", /* 0x00e0 */
194 "SBM_GETPOS32", /* 0x00e1 */
195 "SBM_SETRANGE32", /* 0x00e2 */
196 "SBM_GETRANGE32", /* 0x00e3 */
197 "SBM_ENABLE_ARROWS32", /* 0x00e4 */
199 "SBM_SETRANGEREDRAW32", /* 0x00e6 */
201 "SBM_SETSCROLLINFO32", /* 0x00e9 */
202 "SBM_GETSCROLLINFO32", /* 0x00ea */
203 NULL
, NULL
, NULL
, NULL
, NULL
,
205 /* 0x00F0 - Win32 Buttons */
206 "BM_GETCHECK32", /* 0x00f0 */
207 "BM_SETCHECK32", /* 0x00f1 */
208 "BM_GETSTATE32", /* 0x00f2 */
209 "BM_SETSTATE32", /* 0x00f3 */
210 "BM_SETSTYLE32", /* 0x00f4 */
211 "BM_CLICK32", /* 0x00f5 */
212 "BM_GETIMAGE32", /* 0x00f6 */
213 "BM_SETIMAGE32", /* 0x00f7 */
214 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
216 "WM_KEYDOWN", /* 0x0100 */
217 "WM_KEYUP", /* 0x0101 */
218 "WM_CHAR", /* 0x0102 */
219 "WM_DEADCHAR", /* 0x0103 */
220 "WM_SYSKEYDOWN", /* 0x0104 */
221 "WM_SYSKEYUP", /* 0x0105 */
222 "WM_SYSCHAR", /* 0x0106 */
223 "WM_SYSDEADCHAR", /* 0x0107 */
224 "WM_KEYLAST", /* 0x0108 */
228 "WM_INTERIM", NULL
, NULL
, NULL
,
230 "WM_INITDIALOG", /* 0x0110 */
231 "WM_COMMAND", /* 0x0111 */
232 "WM_SYSCOMMAND", /* 0x0112 */
233 "WM_TIMER", /* 0x0113 */
234 "WM_HSCROLL", /* 0x0114 */
235 "WM_VSCROLL", /* 0x0115 */
236 "WM_INITMENU", /* 0x0116 */
237 "WM_INITMENUPOPUP", /* 0x0117 */
238 "WM_SYSTIMER", /* 0x0118 */
239 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
240 "WM_MENUSELECT", /* 0x011f */
242 "WM_MENUCHAR", /* 0x0120 */
243 "WM_ENTERIDLE", /* 0x0121 */
244 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
245 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
249 "wm_lbtrackpoint", /* 0x0131 */
250 "WM_CTLCOLORMSGBOX", /* 0x0132 */
251 "WM_CTLCOLOREDIT", /* 0x0133 */
252 "WM_CTLCOLORLISTBOX", /* 0x0134 */
253 "WM_CTLCOLORBTN", /* 0x0135 */
254 "WM_CTLCOLORDLG", /* 0x0136 */
255 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
256 "WM_CTLCOLORSTATIC", /* 0x0138 */
257 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
259 /* 0x0140 - Win32 Comboboxes */
260 "CB_GETEDITSEL32", /* 0x0140 */
261 "CB_LIMITTEXT32", /* 0x0141 */
262 "CB_SETEDITSEL32", /* 0x0142 */
263 "CB_ADDSTRING32", /* 0x0143 */
264 "CB_DELETESTRING32", /* 0x0144 */
265 "CB_DIR32", /* 0x0145 */
266 "CB_GETCOUNT32", /* 0x0146 */
267 "CB_GETCURSEL32", /* 0x0147 */
268 "CB_GETLBTEXT32", /* 0x0148 */
269 "CB_GETLBTEXTLEN32", /* 0x0149 */
270 "CB_INSERTSTRING32", /* 0x014a */
271 "CB_RESETCONTENT32", /* 0x014b */
272 "CB_FINDSTRING32", /* 0x014c */
273 "CB_SELECTSTRING32", /* 0x014d */
274 "CB_SETCURSEL32", /* 0x014e */
275 "CB_SHOWDROPDOWN32", /* 0x014f */
277 "CB_GETITEMDATA32", /* 0x0150 */
278 "CB_SETITEMDATA32", /* 0x0151 */
279 "CB_GETDROPPEDCONTROLRECT32",/* 0x0152 */
280 "CB_SETITEMHEIGHT32", /* 0x0153 */
281 "CB_GETITEMHEIGHT32", /* 0x0154 */
282 "CB_SETEXTENDEDUI32", /* 0x0155 */
283 "CB_GETEXTENDEDUI32", /* 0x0156 */
284 "CB_GETDROPPEDSTATE32", /* 0x0157 */
285 "CB_FINDSTRINGEXACT32", /* 0x0158 */
286 "CB_SETLOCALE32", /* 0x0159 */
287 "CB_GETLOCALE32", /* 0x015a */
288 "CB_GETTOPINDEX32", /* 0x015b */
289 "CB_SETTOPINDEX32", /* 0x015c */
290 "CB_GETHORIZONTALEXTENT32", /* 0x015d */
291 "CB_SETHORIZONTALEXTENT32", /* 0x015e */
292 "CB_GETDROPPEDWIDTH32", /* 0x015f */
294 "CB_SETDROPPEDWIDTH32", /* 0x0160 */
295 "CB_INITSTORAGE32", /* 0x0161 */
296 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
297 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
299 /* 0x0170 - Win32 Static controls */
300 "STM_SETICON32", /* 0x0170 */
301 "STM_GETICON32", /* 0x0171 */
302 "STM_SETIMAGE32", /* 0x0172 */
303 "STM_GETIMAGE32", /* 0x0173 */
304 NULL
, NULL
, NULL
, NULL
,
305 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
307 /* 0x0180 - Win32 Listboxes */
308 "LB_ADDSTRING32", /* 0x0180 */
309 "LB_INSERTSTRING32", /* 0x0181 */
310 "LB_DELETESTRING32", /* 0x0182 */
311 "LB_SELITEMRANGEEX32", /* 0x0183 */
312 "LB_RESETCONTENT32", /* 0x0184 */
313 "LB_SETSEL32", /* 0x0185 */
314 "LB_SETCURSEL32", /* 0x0186 */
315 "LB_GETSEL32", /* 0x0187 */
316 "LB_GETCURSEL32", /* 0x0188 */
317 "LB_GETTEXT32", /* 0x0189 */
318 "LB_GETTEXTLEN32", /* 0x018a */
319 "LB_GETCOUNT32", /* 0x018b */
320 "LB_SELECTSTRING32", /* 0x018c */
321 "LB_DIR32", /* 0x018d */
322 "LB_GETTOPINDEX32", /* 0x018e */
323 "LB_FINDSTRING32", /* 0x018f */
325 "LB_GETSELCOUNT32", /* 0x0190 */
326 "LB_GETSELITEMS32", /* 0x0191 */
327 "LB_SETTABSTOPS32", /* 0x0192 */
328 "LB_GETHORIZONTALEXTENT32", /* 0x0193 */
329 "LB_SETHORIZONTALEXTENT32", /* 0x0194 */
330 "LB_SETCOLUMNWIDTH32", /* 0x0195 */
331 "LB_ADDFILE32", /* 0x0196 */
332 "LB_SETTOPINDEX32", /* 0x0197 */
333 "LB_GETITEMRECT32", /* 0x0198 */
334 "LB_GETITEMDATA32", /* 0x0199 */
335 "LB_SETITEMDATA32", /* 0x019a */
336 "LB_SELITEMRANGE32", /* 0x019b */
337 "LB_SETANCHORINDEX32", /* 0x019c */
338 "LB_GETANCHORINDEX32", /* 0x019d */
339 "LB_SETCARETINDEX32", /* 0x019e */
340 "LB_GETCARETINDEX32", /* 0x019f */
342 "LB_SETITEMHEIGHT32", /* 0x01a0 */
343 "LB_GETITEMHEIGHT32", /* 0x01a1 */
344 "LB_FINDSTRINGEXACT32", /* 0x01a2 */
345 "LB_CARETON32", /* 0x01a3 */
346 "LB_CARETOFF32", /* 0x01a4 */
347 "LB_SETLOCALE32", /* 0x01a5 */
348 "LB_GETLOCALE32", /* 0x01a6 */
349 "LB_SETCOUNT32", /* 0x01a7 */
350 "LB_INITSTORAGE32", /* 0x01a8 */
351 "LB_ITEMFROMPOINT32", /* 0x01a9 */
352 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
355 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
356 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
359 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
360 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
363 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
364 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
367 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
368 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
371 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
372 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
374 "WM_MOUSEMOVE", /* 0x0200 */
375 "WM_LBUTTONDOWN", /* 0x0201 */
376 "WM_LBUTTONUP", /* 0x0202 */
377 "WM_LBUTTONDBLCLK", /* 0x0203 */
378 "WM_RBUTTONDOWN", /* 0x0204 */
379 "WM_RBUTTONUP", /* 0x0205 */
380 "WM_RBUTTONDBLCLK", /* 0x0206 */
381 "WM_MBUTTONDOWN", /* 0x0207 */
382 "WM_MBUTTONUP", /* 0x0208 */
383 "WM_MBUTTONDBLCLK", /* 0x0209 */
384 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
386 "WM_PARENTNOTIFY", /* 0x0210 */
387 "WM_ENTERMENULOOP", /* 0x0211 */
388 "WM_EXITMENULOOP", /* 0x0212 */
389 "wm_nextmenu", /* 0x0213 */
394 "WM_DEVICECHANGE", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
396 "WM_MDICREATE", /* 0x0220 */
397 "WM_MDIDESTROY", /* 0x0221 */
398 "WM_MDIACTIVATE", /* 0x0222 */
399 "WM_MDIRESTORE", /* 0x0223 */
400 "WM_MDINEXT", /* 0x0224 */
401 "WM_MDIMAXIMIZE", /* 0x0225 */
402 "WM_MDITILE", /* 0x0226 */
403 "WM_MDICASCADE", /* 0x0227 */
404 "WM_MDIICONARRANGE", /* 0x0228 */
405 "WM_MDIGETACTIVE", /* 0x0229 */
408 "wm_querydropobject",
415 "WM_MDISETMENU", /* 0x0230 */
416 "WM_ENTERSIZEMOVE", /* 0x0231 */
417 "WM_EXITSIZEMOVE", /* 0x0232 */
418 "WM_DROPFILES", /* 0x0233 */
419 "WM_MDIREFRESHMENU", NULL
, NULL
, NULL
,
421 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
424 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
425 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
428 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
429 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
432 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
433 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
434 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
435 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
438 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
439 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
440 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
441 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
443 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
444 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
445 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
446 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
449 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
450 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
451 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
452 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
454 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
455 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
456 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
457 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
459 "WM_CUT", /* 0x0300 */
465 "WM_RENDERALLFORMATS",
466 "WM_DESTROYCLIPBOARD",
469 "WM_VSCROLLCLIPBOARD",
471 "WM_ASKCBFORMATNAME",
473 "WM_HSCROLLCLIPBOARD",
474 "WM_QUERYNEWPALETTE", /* 0x030f*/
476 "WM_PALETTEISCHANGING",
478 "WM_HOTKEY", /* 0x0312 */
479 NULL
, NULL
, NULL
, NULL
,
482 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
484 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
485 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
486 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
487 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
490 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
491 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
492 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
493 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
495 "WM_QUERYAFXWNDPROC", /* 0x0360 */
496 "WM_SIZEPARENT", /* 0x0361 */
497 "WM_SETMESSAGESTRING", /* 0x0362 */
498 "WM_IDLEUPDATECMDUI", /* 0x0363 */
499 "WM_INITIALUPDATE", /* 0x0364 */
500 "WM_COMMANDHELP", /* 0x0365 */
501 "WM_HELPHITTEST", /* 0x0366 */
502 "WM_EXITHELPMODE", /* 0x0367 */
503 "WM_RECALCPARENT", /* 0x0368 */
504 "WM_SIZECHILD", /* 0x0369 */
505 "WM_KICKIDLE", /* 0x036A */
506 "WM_QUERYCENTERWND", /* 0x036B */
507 "WM_DISABLEMODAL", /* 0x036C */
508 "WM_FLOATSTATUS", /* 0x036D */
509 "WM_ACTIVATETOPLEVEL", /* 0x036E */
510 "WM_QUERY3DCONTROLS", /* 0x036F */
512 "WM_SOCKET_NOTIFY", /* 0x0373 */
513 "WM_SOCKET_DEAD", /* 0x0374 */
514 "WM_POPMESSAGESTRING", /* 0x0375 */
515 "WM_OCC_LOADFROMSTREAM", /* 0x0376 */
516 "WM_OCC_LOADFROMSTORAGE", /* 0x0377 */
517 "WM_OCC_INITNEW", /* 0x0378 */
518 "WM_QUEUE_SENTINEL", /* 0x0379 */
519 "WM_OCC_LOADFROMSTREAM_EX", /* 0x037A */
520 "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */
532 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
535 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
536 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
544 NULL
, NULL
, NULL
, NULL
,
545 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
548 NULL
, NULL
, NULL
, NULL
, NULL
,
572 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
573 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
574 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
577 "WM_DDE_INITIATE", /* 0x3E0 */
578 "WM_DDE_TERMINATE", /* 0x3E1 */
579 "WM_DDE_ADVISE", /* 0x3E2 */
580 "WM_DDE_UNADVISE", /* 0x3E3 */
581 "WM_DDE_ACK", /* 0x3E4 */
582 "WM_DDE_DATA", /* 0x3E5 */
583 "WM_DDE_REQUEST", /* 0x3E6 */
584 "WM_DDE_POKE", /* 0x3E7 */
585 "WM_DDE_EXECUTE", /* 0x3E8 */
586 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
590 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
591 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
597 static BOOL16 SPY_Exclude
[SPY_MAX_MSGNUM
+1];
598 static BOOL16 SPY_ExcludeDWP
= 0;
599 static int SPY_IndentLevel
= 0;
601 #define SPY_EXCLUDE(msg) \
602 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
604 /***********************************************************************
607 const char *SPY_GetMsgName( UINT32 msg
)
609 static char msg_buffer
[20];
611 if (msg
<= SPY_MAX_MSGNUM
)
613 if (!MessageTypeNames
[msg
]) return "???";
614 return MessageTypeNames
[msg
];
616 sprintf( msg_buffer
, "WM_USER+%04x", msg
- WM_USER
);
620 /***********************************************************************
623 const char *SPY_GetWndName( HWND32 hwnd
)
625 static char wnd_buffer
[16];
627 WND
* pWnd
= WIN_FindWndPtr( hwnd
);
630 INT32 n
= sizeof(wnd_buffer
) - 6;
631 LPSTR p
= wnd_buffer
;
636 if( pWnd
->text
&& pWnd
->text
[0] != '\0' )
639 *(p
++) = postfix
= '\"';
640 while ((n
-- > 1) && *src
) *p
++ = *src
++;
642 else /* get class name */
647 GlobalGetAtomName32A( pWnd
->class->atomName
, p
, n
+ 1);
648 src
= p
+= (len
= lstrlen32A(p
));
649 if( len
>= n
) src
= wnd_buffer
; /* something nonzero */
652 if( *src
) for( n
= 0; n
< 3; n
++ ) *(p
++)='.';
656 else lstrcpy32A( wnd_buffer
, "\"NULL\"" );
660 /***********************************************************************
663 void SPY_EnterMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
,
664 WPARAM32 wParam
, LPARAM lParam
)
668 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
)) return;
670 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
673 case SPY_DISPATCHMESSAGE16
:
674 pname
= SPY_GetWndName(hWnd
);
675 TRACE(message
,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
676 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
680 case SPY_DISPATCHMESSAGE32
:
681 pname
= SPY_GetWndName(hWnd
);
682 TRACE(message
,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
683 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
687 case SPY_SENDMESSAGE16
:
688 case SPY_SENDMESSAGE32
:
691 HTASK16 hTask
= GetWindowTask16(hWnd
);
693 if (hTask
== GetCurrentTask()) strcpy( taskName
, "self" );
694 else if (!hTask
) strcpy( taskName
, "Wine" );
697 sprintf( taskName
, "task %04x ???", hTask
);
698 GetModuleName( hTask
, taskName
+ 10, sizeof(taskName
) - 10 );
700 pname
= SPY_GetWndName(hWnd
);
702 if (iFlag
== SPY_SENDMESSAGE16
)
703 TRACE(message
, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
704 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
705 taskName
, wParam
, lParam
);
707 TRACE(message
, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
708 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
709 taskName
, wParam
, lParam
);
713 case SPY_DEFWNDPROC16
:
714 if( SPY_ExcludeDWP
) return;
715 TRACE(message
, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
716 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
717 msg
, wParam
, lParam
);
720 case SPY_DEFWNDPROC32
:
721 if( SPY_ExcludeDWP
) return;
722 TRACE(message
, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
723 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
724 msg
, wParam
, lParam
);
727 SPY_IndentLevel
+= SPY_INDENT_UNIT
;
731 /***********************************************************************
734 void SPY_ExitMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
, LRESULT lReturn
)
738 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
) ||
739 (SPY_ExcludeDWP
&& (iFlag
== SPY_RESULT_DEFWND16
|| iFlag
== SPY_RESULT_DEFWND32
)) )
742 if (SPY_IndentLevel
) SPY_IndentLevel
-= SPY_INDENT_UNIT
;
746 case SPY_RESULT_DEFWND16
:
747 TRACE(message
," %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
748 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
751 case SPY_RESULT_DEFWND32
:
752 TRACE(message
," %*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
753 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
756 case SPY_RESULT_OK16
:
757 pname
= SPY_GetWndName(hWnd
);
758 TRACE(message
," %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
759 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
760 SPY_GetMsgName( msg
), lReturn
);
763 case SPY_RESULT_OK32
:
764 pname
= SPY_GetWndName(hWnd
);
765 TRACE(message
," %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
766 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
767 SPY_GetMsgName( msg
), lReturn
);
770 case SPY_RESULT_INVALIDHWND16
:
771 pname
= SPY_GetWndName(hWnd
);
772 WARN(message
, " %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
773 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
774 SPY_GetMsgName( msg
) );
777 case SPY_RESULT_INVALIDHWND32
:
778 pname
= SPY_GetWndName(hWnd
);
779 WARN(message
, " %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
780 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
781 SPY_GetMsgName( msg
) );
787 /***********************************************************************
795 if (!TRACE_ON(message
)) return TRUE
;
797 PROFILE_GetWineIniString( "Spy", "Include", "", buffer
, sizeof(buffer
) );
798 if (buffer
[0] && strcmp( buffer
, "INCLUDEALL" ))
800 TRACE(message
, "Include=%s\n", buffer
);
801 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
802 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && !strstr(buffer
,MessageTypeNames
[i
]));
805 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer
, sizeof(buffer
) );
808 TRACE(message
, "Exclude=%s\n", buffer
);
809 if (!strcmp( buffer
, "EXCLUDEALL" ))
810 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++) SPY_Exclude
[i
] = TRUE
;
812 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
813 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && strstr(buffer
,MessageTypeNames
[i
]));
816 SPY_ExcludeDWP
= PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 );