2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
18 #define SPY_MAX_MSGNUM WM_USER
19 #define SPY_INDENT_UNIT 4 /* 4 spaces */
21 static const char * const MessageTypeNames
[SPY_MAX_MSGNUM
+ 1] =
39 "WM_CLOSE", /* 0x10 */
55 "WM_SETCURSOR", /* 0x20 */
71 "WM_SETFONT", /* 0x30 */
83 "wm_otherwindowcreated",
84 "wm_otherwindowdestroyed",
85 "wm_activateshellwindow",
89 "wm_compacting", NULL
, NULL
,
90 "WM_COMMNOTIFY", NULL
,
91 "WM_WINDOWPOSCHANGING", /* 0x0046 */
92 "WM_WINDOWPOSCHANGED", /* 0x0047 */
95 "WM_CANCELJOURNAL", NULL
, NULL
,
99 "WM_INPUTLANGCHANGEREQUEST",
100 "WM_INPUTLANGCHANGE",
104 "WM_NOTIFYFORMAT", NULL
, NULL
,
105 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
108 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
109 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
112 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
120 "WM_SETICON", /* 0x0080 */
121 "WM_NCCREATE", /* 0x0081 */
122 "WM_NCDESTROY", /* 0x0082 */
123 "WM_NCCALCSIZE", /* 0x0083 */
124 "WM_NCHITTEST", /* 0x0084 */
125 "WM_NCPAINT", /* 0x0085 */
126 "WM_NCACTIVATE", /* 0x0086 */
127 "WM_GETDLGCODE", /* 0x0087 */
129 "wm_synctask", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
132 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
133 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
136 "WM_NCMOUSEMOVE", /* 0x00A0 */
137 "WM_NCLBUTTONDOWN", /* 0x00A1 */
138 "WM_NCLBUTTONUP", /* 0x00A2 */
139 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
140 "WM_NCRBUTTONDOWN", /* 0x00A4 */
141 "WM_NCRBUTTONUP", /* 0x00A5 */
142 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
143 "WM_NCMBUTTONDOWN", /* 0x00A7 */
144 "WM_NCMBUTTONUP", /* 0x00A8 */
145 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
146 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
148 /* 0x00B0 - Win32 Edit controls */
149 "EM_GETSEL32", /* 0x00b0 */
150 "EM_SETSEL32", /* 0x00b1 */
151 "EM_GETRECT32", /* 0x00b2 */
152 "EM_SETRECT32", /* 0x00b3 */
153 "EM_SETRECTNP32", /* 0x00b4 */
154 "EM_SCROLL32", /* 0x00b5 */
155 "EM_LINESCROLL32", /* 0x00b6 */
156 "EM_SCROLLCARET32", /* 0x00b7 */
157 "EM_GETMODIFY32", /* 0x00b8 */
158 "EM_SETMODIFY32", /* 0x00b9 */
159 "EM_GETLINECOUNT32", /* 0x00ba */
160 "EM_LINEINDEX32", /* 0x00bb */
161 "EM_SETHANDLE32", /* 0x00bc */
162 "EM_GETHANDLE32", /* 0x00bd */
163 "EM_GETTHUMB32", /* 0x00be */
167 "EM_LINELENGTH32", /* 0x00c1 */
168 "EM_REPLACESEL32", /* 0x00c2 */
170 "EM_GETLINE32", /* 0x00c4 */
171 "EM_LIMITTEXT32", /* 0x00c5 */
172 "EM_CANUNDO32", /* 0x00c6 */
173 "EM_UNDO32", /* 0x00c7 */
174 "EM_FMTLINES32", /* 0x00c8 */
175 "EM_LINEFROMCHAR32", /* 0x00c9 */
177 "EM_SETTABSTOPS32", /* 0x00cb */
178 "EM_SETPASSWORDCHAR32", /* 0x00cc */
179 "EM_EMPTYUNDOBUFFER32", /* 0x00cd */
180 "EM_GETFIRSTVISIBLELINE32", /* 0x00ce */
181 "EM_SETREADONLY32", /* 0x00cf */
183 "EM_SETWORDBREAKPROC32", /* 0x00d0 */
184 "EM_GETWORDBREAKPROC32", /* 0x00d1 */
185 "EM_GETPASSWORDCHAR32", /* 0x00d2 */
186 "EM_SETMARGINS32", /* 0x00d3 */
187 "EM_GETMARGINS32", /* 0x00d4 */
188 "EM_GETLIMITTEXT32", /* 0x00d5 */
189 "EM_POSFROMCHAR32", /* 0x00d6 */
190 "EM_CHARFROMPOS32", /* 0x00d7 */
191 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
193 /* 0x00E0 - Win32 Scrollbars */
194 "SBM_SETPOS32", /* 0x00e0 */
195 "SBM_GETPOS32", /* 0x00e1 */
196 "SBM_SETRANGE32", /* 0x00e2 */
197 "SBM_GETRANGE32", /* 0x00e3 */
198 "SBM_ENABLE_ARROWS32", /* 0x00e4 */
200 "SBM_SETRANGEREDRAW32", /* 0x00e6 */
202 "SBM_SETSCROLLINFO32", /* 0x00e9 */
203 "SBM_GETSCROLLINFO32", /* 0x00ea */
204 NULL
, NULL
, NULL
, NULL
, NULL
,
206 /* 0x00F0 - Win32 Buttons */
207 "BM_GETCHECK32", /* 0x00f0 */
208 "BM_SETCHECK32", /* 0x00f1 */
209 "BM_GETSTATE32", /* 0x00f2 */
210 "BM_SETSTATE32", /* 0x00f3 */
211 "BM_SETSTYLE32", /* 0x00f4 */
212 "BM_CLICK32", /* 0x00f5 */
213 "BM_GETIMAGE32", /* 0x00f6 */
214 "BM_SETIMAGE32", /* 0x00f7 */
215 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
217 "WM_KEYDOWN", /* 0x0100 */
218 "WM_KEYUP", /* 0x0101 */
219 "WM_CHAR", /* 0x0102 */
220 "WM_DEADCHAR", /* 0x0103 */
221 "WM_SYSKEYDOWN", /* 0x0104 */
222 "WM_SYSKEYUP", /* 0x0105 */
223 "WM_SYSCHAR", /* 0x0106 */
224 "WM_SYSDEADCHAR", /* 0x0107 */
225 "WM_KEYLAST", /* 0x0108 */
229 "WM_INTERIM", NULL
, NULL
, NULL
,
231 "WM_INITDIALOG", /* 0x0110 */
232 "WM_COMMAND", /* 0x0111 */
233 "WM_SYSCOMMAND", /* 0x0112 */
234 "WM_TIMER", /* 0x0113 */
235 "WM_HSCROLL", /* 0x0114 */
236 "WM_VSCROLL", /* 0x0115 */
237 "WM_INITMENU", /* 0x0116 */
238 "WM_INITMENUPOPUP", /* 0x0117 */
239 "WM_SYSTIMER", /* 0x0118 */
240 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
241 "WM_MENUSELECT", /* 0x011f */
243 "WM_MENUCHAR", /* 0x0120 */
244 "WM_ENTERIDLE", /* 0x0121 */
245 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
246 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
250 "wm_lbtrackpoint", /* 0x0131 */
251 "WM_CTLCOLORMSGBOX", /* 0x0132 */
252 "WM_CTLCOLOREDIT", /* 0x0133 */
253 "WM_CTLCOLORLISTBOX", /* 0x0134 */
254 "WM_CTLCOLORBTN", /* 0x0135 */
255 "WM_CTLCOLORDLG", /* 0x0136 */
256 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
257 "WM_CTLCOLORSTATIC", /* 0x0138 */
258 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
260 /* 0x0140 - Win32 Comboboxes */
261 "CB_GETEDITSEL32", /* 0x0140 */
262 "CB_LIMITTEXT32", /* 0x0141 */
263 "CB_SETEDITSEL32", /* 0x0142 */
264 "CB_ADDSTRING32", /* 0x0143 */
265 "CB_DELETESTRING32", /* 0x0144 */
266 "CB_DIR32", /* 0x0145 */
267 "CB_GETCOUNT32", /* 0x0146 */
268 "CB_GETCURSEL32", /* 0x0147 */
269 "CB_GETLBTEXT32", /* 0x0148 */
270 "CB_GETLBTEXTLEN32", /* 0x0149 */
271 "CB_INSERTSTRING32", /* 0x014a */
272 "CB_RESETCONTENT32", /* 0x014b */
273 "CB_FINDSTRING32", /* 0x014c */
274 "CB_SELECTSTRING32", /* 0x014d */
275 "CB_SETCURSEL32", /* 0x014e */
276 "CB_SHOWDROPDOWN32", /* 0x014f */
278 "CB_GETITEMDATA32", /* 0x0150 */
279 "CB_SETITEMDATA32", /* 0x0151 */
280 "CB_GETDROPPEDCONTROLRECT32",/* 0x0152 */
281 "CB_SETITEMHEIGHT32", /* 0x0153 */
282 "CB_GETITEMHEIGHT32", /* 0x0154 */
283 "CB_SETEXTENDEDUI32", /* 0x0155 */
284 "CB_GETEXTENDEDUI32", /* 0x0156 */
285 "CB_GETDROPPEDSTATE32", /* 0x0157 */
286 "CB_FINDSTRINGEXACT32", /* 0x0158 */
287 "CB_SETLOCALE32", /* 0x0159 */
288 "CB_GETLOCALE32", /* 0x015a */
289 "CB_GETTOPINDEX32", /* 0x015b */
290 "CB_SETTOPINDEX32", /* 0x015c */
291 "CB_GETHORIZONTALEXTENT32", /* 0x015d */
292 "CB_SETHORIZONTALEXTENT32", /* 0x015e */
293 "CB_GETDROPPEDWIDTH32", /* 0x015f */
295 "CB_SETDROPPEDWIDTH32", /* 0x0160 */
296 "CB_INITSTORAGE32", /* 0x0161 */
297 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
298 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
300 /* 0x0170 - Win32 Static controls */
301 "STM_SETICON32", /* 0x0170 */
302 "STM_GETICON32", /* 0x0171 */
303 "STM_SETIMAGE32", /* 0x0172 */
304 "STM_GETIMAGE32", /* 0x0173 */
305 NULL
, NULL
, NULL
, NULL
,
306 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
308 /* 0x0180 - Win32 Listboxes */
309 "LB_ADDSTRING32", /* 0x0180 */
310 "LB_INSERTSTRING32", /* 0x0181 */
311 "LB_DELETESTRING32", /* 0x0182 */
312 "LB_SELITEMRANGEEX32", /* 0x0183 */
313 "LB_RESETCONTENT32", /* 0x0184 */
314 "LB_SETSEL32", /* 0x0185 */
315 "LB_SETCURSEL32", /* 0x0186 */
316 "LB_GETSEL32", /* 0x0187 */
317 "LB_GETCURSEL32", /* 0x0188 */
318 "LB_GETTEXT32", /* 0x0189 */
319 "LB_GETTEXTLEN32", /* 0x018a */
320 "LB_GETCOUNT32", /* 0x018b */
321 "LB_SELECTSTRING32", /* 0x018c */
322 "LB_DIR32", /* 0x018d */
323 "LB_GETTOPINDEX32", /* 0x018e */
324 "LB_FINDSTRING32", /* 0x018f */
326 "LB_GETSELCOUNT32", /* 0x0190 */
327 "LB_GETSELITEMS32", /* 0x0191 */
328 "LB_SETTABSTOPS32", /* 0x0192 */
329 "LB_GETHORIZONTALEXTENT32", /* 0x0193 */
330 "LB_SETHORIZONTALEXTENT32", /* 0x0194 */
331 "LB_SETCOLUMNWIDTH32", /* 0x0195 */
332 "LB_ADDFILE32", /* 0x0196 */
333 "LB_SETTOPINDEX32", /* 0x0197 */
334 "LB_GETITEMRECT32", /* 0x0198 */
335 "LB_GETITEMDATA32", /* 0x0199 */
336 "LB_SETITEMDATA32", /* 0x019a */
337 "LB_SELITEMRANGE32", /* 0x019b */
338 "LB_SETANCHORINDEX32", /* 0x019c */
339 "LB_GETANCHORINDEX32", /* 0x019d */
340 "LB_SETCARETINDEX32", /* 0x019e */
341 "LB_GETCARETINDEX32", /* 0x019f */
343 "LB_SETITEMHEIGHT32", /* 0x01a0 */
344 "LB_GETITEMHEIGHT32", /* 0x01a1 */
345 "LB_FINDSTRINGEXACT32", /* 0x01a2 */
346 "LB_CARETON32", /* 0x01a3 */
347 "LB_CARETOFF32", /* 0x01a4 */
348 "LB_SETLOCALE32", /* 0x01a5 */
349 "LB_GETLOCALE32", /* 0x01a6 */
350 "LB_SETCOUNT32", /* 0x01a7 */
351 "LB_INITSTORAGE32", /* 0x01a8 */
352 "LB_ITEMFROMPOINT32", /* 0x01a9 */
353 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
356 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
357 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
360 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
361 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
364 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
365 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
368 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
369 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
372 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
373 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
375 "WM_MOUSEMOVE", /* 0x0200 */
376 "WM_LBUTTONDOWN", /* 0x0201 */
377 "WM_LBUTTONUP", /* 0x0202 */
378 "WM_LBUTTONDBLCLK", /* 0x0203 */
379 "WM_RBUTTONDOWN", /* 0x0204 */
380 "WM_RBUTTONUP", /* 0x0205 */
381 "WM_RBUTTONDBLCLK", /* 0x0206 */
382 "WM_MBUTTONDOWN", /* 0x0207 */
383 "WM_MBUTTONUP", /* 0x0208 */
384 "WM_MBUTTONDBLCLK", /* 0x0209 */
385 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
387 "WM_PARENTNOTIFY", /* 0x0210 */
388 "WM_ENTERMENULOOP", /* 0x0211 */
389 "WM_EXITMENULOOP", /* 0x0212 */
390 "wm_nextmenu", /* 0x0213 */
395 "WM_DEVICECHANGE", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
397 "WM_MDICREATE", /* 0x0220 */
398 "WM_MDIDESTROY", /* 0x0221 */
399 "WM_MDIACTIVATE", /* 0x0222 */
400 "WM_MDIRESTORE", /* 0x0223 */
401 "WM_MDINEXT", /* 0x0224 */
402 "WM_MDIMAXIMIZE", /* 0x0225 */
403 "WM_MDITILE", /* 0x0226 */
404 "WM_MDICASCADE", /* 0x0227 */
405 "WM_MDIICONARRANGE", /* 0x0228 */
406 "WM_MDIGETACTIVE", /* 0x0229 */
409 "wm_querydropobject",
416 "WM_MDISETMENU", /* 0x0230 */
417 "WM_ENTERSIZEMOVE", /* 0x0231 */
418 "WM_EXITSIZEMOVE", /* 0x0232 */
419 "WM_DROPFILES", /* 0x0233 */
420 "WM_MDIREFRESHMENU", NULL
, NULL
, NULL
,
422 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
425 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
426 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
429 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
430 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
,
436 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
,
442 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
,
447 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
,
453 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
,
458 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
460 "WM_CUT", /* 0x0300 */
466 "WM_RENDERALLFORMATS",
467 "WM_DESTROYCLIPBOARD",
470 "WM_VSCROLLCLIPBOARD",
472 "WM_ASKCBFORMATNAME",
474 "WM_HSCROLLCLIPBOARD",
475 "WM_QUERYNEWPALETTE", /* 0x030f*/
477 "WM_PALETTEISCHANGING",
479 "WM_HOTKEY", /* 0x0312 */
480 NULL
, NULL
, NULL
, NULL
,
483 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
,
488 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
,
494 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
496 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
497 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
498 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
499 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
509 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
512 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
513 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
521 NULL
, NULL
, NULL
, NULL
,
522 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
525 NULL
, NULL
, NULL
, NULL
, NULL
,
549 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
550 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
551 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
554 "WM_DDE_INITIATE", /* 0x3E0 */
555 "WM_DDE_TERMINATE", /* 0x3E1 */
556 "WM_DDE_ADVISE", /* 0x3E2 */
557 "WM_DDE_UNADVISE", /* 0x3E3 */
558 "WM_DDE_ACK", /* 0x3E4 */
559 "WM_DDE_DATA", /* 0x3E5 */
560 "WM_DDE_REQUEST", /* 0x3E6 */
561 "WM_DDE_POKE", /* 0x3E7 */
562 "WM_DDE_EXECUTE", /* 0x3E8 */
563 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
567 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
568 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
574 static BOOL16 SPY_Exclude
[SPY_MAX_MSGNUM
+1];
575 static BOOL16 SPY_ExcludeDWP
= 0;
576 static int SPY_IndentLevel
= 0;
578 #define SPY_EXCLUDE(msg) \
579 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
581 /***********************************************************************
584 const char *SPY_GetMsgName( UINT32 msg
)
586 static char msg_buffer
[20];
588 if (msg
<= SPY_MAX_MSGNUM
)
590 if (!MessageTypeNames
[msg
]) return "???";
591 return MessageTypeNames
[msg
];
593 sprintf( msg_buffer
, "WM_USER+%04x", msg
- WM_USER
);
597 /***********************************************************************
600 const char *SPY_GetWndName( HWND32 hwnd
)
602 static char wnd_buffer
[16];
604 WND
* pWnd
= WIN_FindWndPtr( hwnd
);
607 INT32 n
= sizeof(wnd_buffer
) - 6;
608 LPSTR p
= wnd_buffer
;
613 if( pWnd
->text
&& pWnd
->text
[0] != '\0' )
616 *(p
++) = postfix
= '\"';
617 while ((n
-- > 1) && *src
) *p
++ = *src
++;
619 else /* get class name */
624 GlobalGetAtomName32A( pWnd
->class->atomName
, p
, n
+ 1);
625 src
= p
+= (len
= lstrlen32A(p
));
626 if( len
>= n
) src
= wnd_buffer
; /* something nonzero */
629 if( *src
) for( n
= 0; n
< 3; n
++ ) *(p
++)='.';
633 else lstrcpy32A( wnd_buffer
, "\"NULL\"" );
637 /***********************************************************************
640 void SPY_EnterMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
,
641 WPARAM32 wParam
, LPARAM lParam
)
645 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
)) return;
647 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
650 case SPY_DISPATCHMESSAGE16
:
651 pname
= SPY_GetWndName(hWnd
);
652 TRACE(message
,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
653 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
657 case SPY_DISPATCHMESSAGE32
:
658 pname
= SPY_GetWndName(hWnd
);
659 TRACE(message
,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
660 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
664 case SPY_SENDMESSAGE16
:
665 case SPY_SENDMESSAGE32
:
668 HTASK16 hTask
= GetWindowTask16(hWnd
);
670 if (hTask
== GetCurrentTask()) strcpy( taskName
, "self" );
671 else if (!hTask
) strcpy( taskName
, "Wine" );
672 else sprintf( taskName
, "task %04x %s",
673 hTask
, MODULE_GetModuleName(hTask
) );
674 pname
= SPY_GetWndName(hWnd
);
676 if (iFlag
== SPY_SENDMESSAGE16
)
677 TRACE(message
, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
678 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
679 taskName
, wParam
, lParam
);
681 TRACE(message
, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
682 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
683 taskName
, wParam
, lParam
);
687 case SPY_DEFWNDPROC16
:
688 if( SPY_ExcludeDWP
) return;
689 TRACE(message
, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
690 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
691 msg
, wParam
, lParam
);
694 case SPY_DEFWNDPROC32
:
695 if( SPY_ExcludeDWP
) return;
696 TRACE(message
, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
697 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
698 msg
, wParam
, lParam
);
701 SPY_IndentLevel
+= SPY_INDENT_UNIT
;
705 /***********************************************************************
708 void SPY_ExitMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
, LRESULT lReturn
)
712 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
) ||
713 (SPY_ExcludeDWP
&& (iFlag
== SPY_RESULT_DEFWND16
|| iFlag
== SPY_RESULT_DEFWND32
)) )
716 if (SPY_IndentLevel
) SPY_IndentLevel
-= SPY_INDENT_UNIT
;
720 case SPY_RESULT_DEFWND16
:
721 TRACE(message
,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
722 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
725 case SPY_RESULT_DEFWND32
:
726 TRACE(message
,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
727 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
730 case SPY_RESULT_OK16
:
731 pname
= SPY_GetWndName(hWnd
);
732 TRACE(message
,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n",
733 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
734 SPY_GetMsgName( msg
), lReturn
);
737 case SPY_RESULT_OK32
:
738 pname
= SPY_GetWndName(hWnd
);
739 TRACE(message
,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n",
740 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
741 SPY_GetMsgName( msg
), lReturn
);
744 case SPY_RESULT_INVALIDHWND16
:
745 pname
= SPY_GetWndName(hWnd
);
746 WARN(message
, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
747 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
748 SPY_GetMsgName( msg
) );
751 case SPY_RESULT_INVALIDHWND32
:
752 pname
= SPY_GetWndName(hWnd
);
753 WARN(message
, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
754 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
755 SPY_GetMsgName( msg
) );
761 /***********************************************************************
769 if (!TRACE_ON(message
)) return TRUE
;
771 PROFILE_GetWineIniString( "Spy", "Include", "", buffer
, sizeof(buffer
) );
772 if (buffer
[0] && strcmp( buffer
, "INCLUDEALL" ))
774 TRACE(message
, "Include=%s\n", buffer
);
775 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
776 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && !strstr(buffer
,MessageTypeNames
[i
]));
779 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer
, sizeof(buffer
) );
782 TRACE(message
, "Exclude=%s\n", buffer
);
783 if (!strcmp( buffer
, "EXCLUDEALL" ))
784 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++) SPY_Exclude
[i
] = TRUE
;
786 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
787 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && strstr(buffer
,MessageTypeNames
[i
]));
790 SPY_ExcludeDWP
= PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 );