2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
10 #include "wine/winuser16.h"
11 #include "wine/winbase16.h"
18 DEFAULT_DEBUG_CHANNEL(message)
20 #define SPY_MAX_MSGNUM WM_USER
21 #define SPY_INDENT_UNIT 4 /* 4 spaces */
23 static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
41 "WM_CLOSE", /* 0x10 */
57 "WM_SETCURSOR", /* 0x20 */
73 "WM_SETFONT", /* 0x30 */
85 "wm_otherwindowcreated",
86 "wm_otherwindowdestroyed",
87 "wm_activateshellwindow",
91 "wm_compacting", NULL, NULL,
92 "WM_COMMNOTIFY", NULL,
93 "WM_WINDOWPOSCHANGING", /* 0x0046 */
94 "WM_WINDOWPOSCHANGED", /* 0x0047 */
97 "WM_CANCELJOURNAL", NULL, NULL,
101 "WM_INPUTLANGCHANGEREQUEST",
102 "WM_INPUTLANGCHANGE",
106 "WM_NOTIFYFORMAT", NULL, NULL,
107 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
110 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
111 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
114 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
122 "WM_SETICON", /* 0x0080 */
123 "WM_NCCREATE", /* 0x0081 */
124 "WM_NCDESTROY", /* 0x0082 */
125 "WM_NCCALCSIZE", /* 0x0083 */
126 "WM_NCHITTEST", /* 0x0084 */
127 "WM_NCPAINT", /* 0x0085 */
128 "WM_NCACTIVATE", /* 0x0086 */
129 "WM_GETDLGCODE", /* 0x0087 */
131 "wm_synctask", NULL, NULL, NULL, NULL, NULL, NULL,
134 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
135 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
138 "WM_NCMOUSEMOVE", /* 0x00A0 */
139 "WM_NCLBUTTONDOWN", /* 0x00A1 */
140 "WM_NCLBUTTONUP", /* 0x00A2 */
141 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
142 "WM_NCRBUTTONDOWN", /* 0x00A4 */
143 "WM_NCRBUTTONUP", /* 0x00A5 */
144 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
145 "WM_NCMBUTTONDOWN", /* 0x00A7 */
146 "WM_NCMBUTTONUP", /* 0x00A8 */
147 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
148 NULL, NULL, NULL, NULL, NULL, NULL,
150 /* 0x00B0 - Win32 Edit controls */
151 "EM_GETSEL32", /* 0x00b0 */
152 "EM_SETSEL32", /* 0x00b1 */
153 "EM_GETRECT32", /* 0x00b2 */
154 "EM_SETRECT32", /* 0x00b3 */
155 "EM_SETRECTNP32", /* 0x00b4 */
156 "EM_SCROLL32", /* 0x00b5 */
157 "EM_LINESCROLL32", /* 0x00b6 */
158 "EM_SCROLLCARET32", /* 0x00b7 */
159 "EM_GETMODIFY32", /* 0x00b8 */
160 "EM_SETMODIFY32", /* 0x00b9 */
161 "EM_GETLINECOUNT32", /* 0x00ba */
162 "EM_LINEINDEX32", /* 0x00bb */
163 "EM_SETHANDLE32", /* 0x00bc */
164 "EM_GETHANDLE32", /* 0x00bd */
165 "EM_GETTHUMB32", /* 0x00be */
169 "EM_LINELENGTH32", /* 0x00c1 */
170 "EM_REPLACESEL32", /* 0x00c2 */
172 "EM_GETLINE32", /* 0x00c4 */
173 "EM_LIMITTEXT32", /* 0x00c5 */
174 "EM_CANUNDO32", /* 0x00c6 */
175 "EM_UNDO32", /* 0x00c7 */
176 "EM_FMTLINES32", /* 0x00c8 */
177 "EM_LINEFROMCHAR32", /* 0x00c9 */
179 "EM_SETTABSTOPS32", /* 0x00cb */
180 "EM_SETPASSWORDCHAR32", /* 0x00cc */
181 "EM_EMPTYUNDOBUFFER32", /* 0x00cd */
182 "EM_GETFIRSTVISIBLELINE32", /* 0x00ce */
183 "EM_SETREADONLY32", /* 0x00cf */
185 "EM_SETWORDBREAKPROC32", /* 0x00d0 */
186 "EM_GETWORDBREAKPROC32", /* 0x00d1 */
187 "EM_GETPASSWORDCHAR32", /* 0x00d2 */
188 "EM_SETMARGINS32", /* 0x00d3 */
189 "EM_GETMARGINS32", /* 0x00d4 */
190 "EM_GETLIMITTEXT32", /* 0x00d5 */
191 "EM_POSFROMCHAR32", /* 0x00d6 */
192 "EM_CHARFROMPOS32", /* 0x00d7 */
193 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
195 /* 0x00E0 - Win32 Scrollbars */
196 "SBM_SETPOS32", /* 0x00e0 */
197 "SBM_GETPOS32", /* 0x00e1 */
198 "SBM_SETRANGE32", /* 0x00e2 */
199 "SBM_GETRANGE32", /* 0x00e3 */
200 "SBM_ENABLE_ARROWS32", /* 0x00e4 */
202 "SBM_SETRANGEREDRAW32", /* 0x00e6 */
204 "SBM_SETSCROLLINFO32", /* 0x00e9 */
205 "SBM_GETSCROLLINFO32", /* 0x00ea */
206 NULL, NULL, NULL, NULL, NULL,
208 /* 0x00F0 - Win32 Buttons */
209 "BM_GETCHECK32", /* 0x00f0 */
210 "BM_SETCHECK32", /* 0x00f1 */
211 "BM_GETSTATE32", /* 0x00f2 */
212 "BM_SETSTATE32", /* 0x00f3 */
213 "BM_SETSTYLE32", /* 0x00f4 */
214 "BM_CLICK32", /* 0x00f5 */
215 "BM_GETIMAGE32", /* 0x00f6 */
216 "BM_SETIMAGE32", /* 0x00f7 */
217 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
219 "WM_KEYDOWN", /* 0x0100 */
220 "WM_KEYUP", /* 0x0101 */
221 "WM_CHAR", /* 0x0102 */
222 "WM_DEADCHAR", /* 0x0103 */
223 "WM_SYSKEYDOWN", /* 0x0104 */
224 "WM_SYSKEYUP", /* 0x0105 */
225 "WM_SYSCHAR", /* 0x0106 */
226 "WM_SYSDEADCHAR", /* 0x0107 */
227 "WM_KEYLAST", /* 0x0108 */
231 "WM_INTERIM", NULL, NULL, NULL,
233 "WM_INITDIALOG", /* 0x0110 */
234 "WM_COMMAND", /* 0x0111 */
235 "WM_SYSCOMMAND", /* 0x0112 */
236 "WM_TIMER", /* 0x0113 */
237 "WM_HSCROLL", /* 0x0114 */
238 "WM_VSCROLL", /* 0x0115 */
239 "WM_INITMENU", /* 0x0116 */
240 "WM_INITMENUPOPUP", /* 0x0117 */
241 "WM_SYSTIMER", /* 0x0118 */
242 NULL, NULL, NULL, NULL, NULL, NULL,
243 "WM_MENUSELECT", /* 0x011f */
245 "WM_MENUCHAR", /* 0x0120 */
246 "WM_ENTERIDLE", /* 0x0121 */
247 NULL, NULL, NULL, NULL, NULL, NULL,
248 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
252 "wm_lbtrackpoint", /* 0x0131 */
253 "WM_CTLCOLORMSGBOX", /* 0x0132 */
254 "WM_CTLCOLOREDIT", /* 0x0133 */
255 "WM_CTLCOLORLISTBOX", /* 0x0134 */
256 "WM_CTLCOLORBTN", /* 0x0135 */
257 "WM_CTLCOLORDLG", /* 0x0136 */
258 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
259 "WM_CTLCOLORSTATIC", /* 0x0138 */
260 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
262 /* 0x0140 - Win32 Comboboxes */
263 "CB_GETEDITSEL32", /* 0x0140 */
264 "CB_LIMITTEXT32", /* 0x0141 */
265 "CB_SETEDITSEL32", /* 0x0142 */
266 "CB_ADDSTRING32", /* 0x0143 */
267 "CB_DELETESTRING32", /* 0x0144 */
268 "CB_DIR32", /* 0x0145 */
269 "CB_GETCOUNT32", /* 0x0146 */
270 "CB_GETCURSEL32", /* 0x0147 */
271 "CB_GETLBTEXT32", /* 0x0148 */
272 "CB_GETLBTEXTLEN32", /* 0x0149 */
273 "CB_INSERTSTRING32", /* 0x014a */
274 "CB_RESETCONTENT32", /* 0x014b */
275 "CB_FINDSTRING32", /* 0x014c */
276 "CB_SELECTSTRING32", /* 0x014d */
277 "CB_SETCURSEL32", /* 0x014e */
278 "CB_SHOWDROPDOWN32", /* 0x014f */
280 "CB_GETITEMDATA32", /* 0x0150 */
281 "CB_SETITEMDATA32", /* 0x0151 */
282 "CB_GETDROPPEDCONTROLRECT32",/* 0x0152 */
283 "CB_SETITEMHEIGHT32", /* 0x0153 */
284 "CB_GETITEMHEIGHT32", /* 0x0154 */
285 "CB_SETEXTENDEDUI32", /* 0x0155 */
286 "CB_GETEXTENDEDUI32", /* 0x0156 */
287 "CB_GETDROPPEDSTATE32", /* 0x0157 */
288 "CB_FINDSTRINGEXACT32", /* 0x0158 */
289 "CB_SETLOCALE32", /* 0x0159 */
290 "CB_GETLOCALE32", /* 0x015a */
291 "CB_GETTOPINDEX32", /* 0x015b */
292 "CB_SETTOPINDEX32", /* 0x015c */
293 "CB_GETHORIZONTALEXTENT32", /* 0x015d */
294 "CB_SETHORIZONTALEXTENT32", /* 0x015e */
295 "CB_GETDROPPEDWIDTH32", /* 0x015f */
297 "CB_SETDROPPEDWIDTH32", /* 0x0160 */
298 "CB_INITSTORAGE32", /* 0x0161 */
299 NULL, NULL, NULL, NULL, NULL, NULL,
300 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
302 /* 0x0170 - Win32 Static controls */
303 "STM_SETICON32", /* 0x0170 */
304 "STM_GETICON32", /* 0x0171 */
305 "STM_SETIMAGE32", /* 0x0172 */
306 "STM_GETIMAGE32", /* 0x0173 */
307 NULL, NULL, NULL, NULL,
308 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
310 /* 0x0180 - Win32 Listboxes */
311 "LB_ADDSTRING32", /* 0x0180 */
312 "LB_INSERTSTRING32", /* 0x0181 */
313 "LB_DELETESTRING32", /* 0x0182 */
314 "LB_SELITEMRANGEEX32", /* 0x0183 */
315 "LB_RESETCONTENT32", /* 0x0184 */
316 "LB_SETSEL32", /* 0x0185 */
317 "LB_SETCURSEL32", /* 0x0186 */
318 "LB_GETSEL32", /* 0x0187 */
319 "LB_GETCURSEL32", /* 0x0188 */
320 "LB_GETTEXT32", /* 0x0189 */
321 "LB_GETTEXTLEN32", /* 0x018a */
322 "LB_GETCOUNT32", /* 0x018b */
323 "LB_SELECTSTRING32", /* 0x018c */
324 "LB_DIR32", /* 0x018d */
325 "LB_GETTOPINDEX32", /* 0x018e */
326 "LB_FINDSTRING32", /* 0x018f */
328 "LB_GETSELCOUNT32", /* 0x0190 */
329 "LB_GETSELITEMS32", /* 0x0191 */
330 "LB_SETTABSTOPS32", /* 0x0192 */
331 "LB_GETHORIZONTALEXTENT32", /* 0x0193 */
332 "LB_SETHORIZONTALEXTENT32", /* 0x0194 */
333 "LB_SETCOLUMNWIDTH32", /* 0x0195 */
334 "LB_ADDFILE32", /* 0x0196 */
335 "LB_SETTOPINDEX32", /* 0x0197 */
336 "LB_GETITEMRECT32", /* 0x0198 */
337 "LB_GETITEMDATA32", /* 0x0199 */
338 "LB_SETITEMDATA32", /* 0x019a */
339 "LB_SELITEMRANGE32", /* 0x019b */
340 "LB_SETANCHORINDEX32", /* 0x019c */
341 "LB_GETANCHORINDEX32", /* 0x019d */
342 "LB_SETCARETINDEX32", /* 0x019e */
343 "LB_GETCARETINDEX32", /* 0x019f */
345 "LB_SETITEMHEIGHT32", /* 0x01a0 */
346 "LB_GETITEMHEIGHT32", /* 0x01a1 */
347 "LB_FINDSTRINGEXACT32", /* 0x01a2 */
348 "LB_CARETON32", /* 0x01a3 */
349 "LB_CARETOFF32", /* 0x01a4 */
350 "LB_SETLOCALE32", /* 0x01a5 */
351 "LB_GETLOCALE32", /* 0x01a6 */
352 "LB_SETCOUNT32", /* 0x01a7 */
353 "LB_INITSTORAGE32", /* 0x01a8 */
354 "LB_ITEMFROMPOINT32", /* 0x01a9 */
355 NULL, NULL, NULL, NULL, NULL, NULL,
358 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
359 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
362 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
363 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
366 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
367 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
370 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
371 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
374 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
375 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
377 "WM_MOUSEMOVE", /* 0x0200 */
378 "WM_LBUTTONDOWN", /* 0x0201 */
379 "WM_LBUTTONUP", /* 0x0202 */
380 "WM_LBUTTONDBLCLK", /* 0x0203 */
381 "WM_RBUTTONDOWN", /* 0x0204 */
382 "WM_RBUTTONUP", /* 0x0205 */
383 "WM_RBUTTONDBLCLK", /* 0x0206 */
384 "WM_MBUTTONDOWN", /* 0x0207 */
385 "WM_MBUTTONUP", /* 0x0208 */
386 "WM_MBUTTONDBLCLK", /* 0x0209 */
387 NULL, NULL, NULL, NULL, NULL, NULL,
389 "WM_PARENTNOTIFY", /* 0x0210 */
390 "WM_ENTERMENULOOP", /* 0x0211 */
391 "WM_EXITMENULOOP", /* 0x0212 */
392 "wm_nextmenu", /* 0x0213 */
397 "WM_DEVICECHANGE", NULL, NULL, NULL, NULL, NULL, NULL,
399 "WM_MDICREATE", /* 0x0220 */
400 "WM_MDIDESTROY", /* 0x0221 */
401 "WM_MDIACTIVATE", /* 0x0222 */
402 "WM_MDIRESTORE", /* 0x0223 */
403 "WM_MDINEXT", /* 0x0224 */
404 "WM_MDIMAXIMIZE", /* 0x0225 */
405 "WM_MDITILE", /* 0x0226 */
406 "WM_MDICASCADE", /* 0x0227 */
407 "WM_MDIICONARRANGE", /* 0x0228 */
408 "WM_MDIGETACTIVE", /* 0x0229 */
411 "wm_querydropobject",
418 "WM_MDISETMENU", /* 0x0230 */
419 "WM_ENTERSIZEMOVE", /* 0x0231 */
420 "WM_EXITSIZEMOVE", /* 0x0232 */
421 "WM_DROPFILES", /* 0x0233 */
422 "WM_MDIREFRESHMENU", NULL, NULL, NULL,
424 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
427 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
428 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
431 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
432 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,
437 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
438 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,
443 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
444 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,
448 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
449 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,
454 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
455 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,
459 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
460 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
462 "WM_CUT", /* 0x0300 */
468 "WM_RENDERALLFORMATS",
469 "WM_DESTROYCLIPBOARD",
472 "WM_VSCROLLCLIPBOARD",
474 "WM_ASKCBFORMATNAME",
476 "WM_HSCROLLCLIPBOARD",
477 "WM_QUERYNEWPALETTE", /* 0x030f*/
479 "WM_PALETTEISCHANGING",
481 "WM_HOTKEY", /* 0x0312 */
482 NULL, NULL, NULL, NULL,
485 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,
489 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
490 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,
495 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
496 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
498 "WM_QUERYAFXWNDPROC", /* 0x0360 */
499 "WM_SIZEPARENT", /* 0x0361 */
500 "WM_SETMESSAGESTRING", /* 0x0362 */
501 "WM_IDLEUPDATECMDUI", /* 0x0363 */
502 "WM_INITIALUPDATE", /* 0x0364 */
503 "WM_COMMANDHELP", /* 0x0365 */
504 "WM_HELPHITTEST", /* 0x0366 */
505 "WM_EXITHELPMODE", /* 0x0367 */
506 "WM_RECALCPARENT", /* 0x0368 */
507 "WM_SIZECHILD", /* 0x0369 */
508 "WM_KICKIDLE", /* 0x036A */
509 "WM_QUERYCENTERWND", /* 0x036B */
510 "WM_DISABLEMODAL", /* 0x036C */
511 "WM_FLOATSTATUS", /* 0x036D */
512 "WM_ACTIVATETOPLEVEL", /* 0x036E */
513 "WM_QUERY3DCONTROLS", /* 0x036F */
515 "WM_SOCKET_NOTIFY", /* 0x0373 */
516 "WM_SOCKET_DEAD", /* 0x0374 */
517 "WM_POPMESSAGESTRING", /* 0x0375 */
518 "WM_OCC_LOADFROMSTREAM", /* 0x0376 */
519 "WM_OCC_LOADFROMSTORAGE", /* 0x0377 */
520 "WM_OCC_INITNEW", /* 0x0378 */
521 "WM_QUEUE_SENTINEL", /* 0x0379 */
522 "WM_OCC_LOADFROMSTREAM_EX", /* 0x037A */
523 "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */
535 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
538 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
539 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
547 NULL, NULL, NULL, NULL,
548 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
551 NULL, NULL, NULL, NULL, NULL,
575 NULL, NULL, NULL, NULL, NULL, NULL,
576 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
577 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
580 "WM_DDE_INITIATE", /* 0x3E0 */
581 "WM_DDE_TERMINATE", /* 0x3E1 */
582 "WM_DDE_ADVISE", /* 0x3E2 */
583 "WM_DDE_UNADVISE", /* 0x3E3 */
584 "WM_DDE_ACK", /* 0x3E4 */
585 "WM_DDE_DATA", /* 0x3E5 */
586 "WM_DDE_REQUEST", /* 0x3E6 */
587 "WM_DDE_POKE", /* 0x3E7 */
588 "WM_DDE_EXECUTE", /* 0x3E8 */
589 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
593 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
594 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
600 static BOOL16 SPY_Exclude[SPY_MAX_MSGNUM+1];
601 static BOOL16 SPY_ExcludeDWP = 0;
602 static int SPY_IndentLevel = 0;
604 #define SPY_EXCLUDE(msg) \
605 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
607 /***********************************************************************
610 const char *SPY_GetMsgName( UINT msg )
612 static char msg_buffer[20];
614 if (msg <= SPY_MAX_MSGNUM)
616 if (!MessageTypeNames[msg]) return "???";
617 return MessageTypeNames[msg];
619 sprintf( msg_buffer, "WM_USER+%04x", msg - WM_USER );
623 /***********************************************************************
626 const char *SPY_GetWndName( HWND hwnd )
628 static char wnd_buffer[16];
630 WND* pWnd = WIN_FindWndPtr( hwnd );
633 INT n = sizeof(wnd_buffer) - 6;
634 LPSTR p = wnd_buffer;
639 if( pWnd->text && pWnd->text[0] != '\0' )
642 *(p++) = postfix = '\"';
643 while ((n-- > 1) && *src) *p++ = *src++;
645 else /* get class name */
650 GlobalGetAtomNameA( pWnd->class->atomName, p, n + 1);
651 src = p += (len = lstrlenA(p));
652 if( len >= n ) src = wnd_buffer; /* something nonzero */
655 if( *src ) for( n = 0; n < 3; n++ ) *(p++)='.';
658 WIN_ReleaseWndPtr(pWnd);
661 else lstrcpyA( wnd_buffer, "\"NULL\"" );
665 /***********************************************************************
668 void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
669 WPARAM wParam, LPARAM lParam )
673 if (!TRACE_ON(message) || SPY_EXCLUDE(msg)) return;
675 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
678 case SPY_DISPATCHMESSAGE16:
679 pname = SPY_GetWndName(hWnd);
680 TRACE(message,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
681 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
685 case SPY_DISPATCHMESSAGE:
686 pname = SPY_GetWndName(hWnd);
687 TRACE(message,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
688 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
692 case SPY_SENDMESSAGE16:
693 case SPY_SENDMESSAGE:
696 HTASK16 hTask = GetWindowTask16(hWnd);
698 if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
699 else if (!hTask) strcpy( taskName, "Wine" );
702 sprintf( taskName, "task %04x ???", hTask );
703 GetModuleName16( hTask, taskName + 10, sizeof(taskName) - 10 );
705 pname = SPY_GetWndName(hWnd);
707 if (iFlag == SPY_SENDMESSAGE16)
708 TRACE(message, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
709 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
710 taskName, wParam, lParam );
712 TRACE(message, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
713 SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
714 taskName, wParam, lParam );
718 case SPY_DEFWNDPROC16:
719 if( SPY_ExcludeDWP ) return;
720 TRACE(message, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
721 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
722 msg, wParam, lParam );
726 if( SPY_ExcludeDWP ) return;
727 TRACE(message, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
728 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
729 msg, wParam, lParam );
732 SPY_IndentLevel += SPY_INDENT_UNIT;
736 /***********************************************************************
739 void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn )
743 if (!TRACE_ON(message) || SPY_EXCLUDE(msg) ||
744 (SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND)) )
747 if (SPY_IndentLevel) SPY_IndentLevel -= SPY_INDENT_UNIT;
751 case SPY_RESULT_DEFWND16:
752 TRACE(message," %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
753 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
756 case SPY_RESULT_DEFWND:
757 TRACE(message," %*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
758 SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
761 case SPY_RESULT_OK16:
762 pname = SPY_GetWndName(hWnd);
763 TRACE(message," %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
764 SPY_IndentLevel, "", hWnd, pname, msg,
765 SPY_GetMsgName( msg ), lReturn );
769 pname = SPY_GetWndName(hWnd);
770 TRACE(message," %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
771 SPY_IndentLevel, "", hWnd, pname, msg,
772 SPY_GetMsgName( msg ), lReturn );
775 case SPY_RESULT_INVALIDHWND16:
776 pname = SPY_GetWndName(hWnd);
777 WARN(message, " %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
778 SPY_IndentLevel, "", hWnd, pname, msg,
779 SPY_GetMsgName( msg ) );
782 case SPY_RESULT_INVALIDHWND:
783 pname = SPY_GetWndName(hWnd);
784 WARN(message, " %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
785 SPY_IndentLevel, "", hWnd, pname, msg,
786 SPY_GetMsgName( msg ) );
792 /***********************************************************************
800 if (!TRACE_ON(message)) return TRUE;
802 PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) );
803 if (buffer[0] && strcmp( buffer, "INCLUDEALL" ))
805 TRACE(message, "Include=%s\n", buffer );
806 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
807 SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
810 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) );
813 TRACE(message, "Exclude=%s\n", buffer );
814 if (!strcmp( buffer, "EXCLUDEALL" ))
815 for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = TRUE;
817 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
818 SPY_Exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i]));
821 SPY_ExcludeDWP = PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 );