2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
10 #include "wine/winuser16.h"
11 #include "wine/winbase16.h"
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 "WM_QUERYAFXWNDPROC", /* 0x0360 */
497 "WM_SIZEPARENT", /* 0x0361 */
498 "WM_SETMESSAGESTRING", /* 0x0362 */
499 "WM_IDLEUPDATECMDUI", /* 0x0363 */
500 "WM_INITIALUPDATE", /* 0x0364 */
501 "WM_COMMANDHELP", /* 0x0365 */
502 "WM_HELPHITTEST", /* 0x0366 */
503 "WM_EXITHELPMODE", /* 0x0367 */
504 "WM_RECALCPARENT", /* 0x0368 */
505 "WM_SIZECHILD", /* 0x0369 */
506 "WM_KICKIDLE", /* 0x036A */
507 "WM_QUERYCENTERWND", /* 0x036B */
508 "WM_DISABLEMODAL", /* 0x036C */
509 "WM_FLOATSTATUS", /* 0x036D */
510 "WM_ACTIVATETOPLEVEL", /* 0x036E */
511 "WM_QUERY3DCONTROLS", /* 0x036F */
513 "WM_SOCKET_NOTIFY", /* 0x0373 */
514 "WM_SOCKET_DEAD", /* 0x0374 */
515 "WM_POPMESSAGESTRING", /* 0x0375 */
516 "WM_OCC_LOADFROMSTREAM", /* 0x0376 */
517 "WM_OCC_LOADFROMSTORAGE", /* 0x0377 */
518 "WM_OCC_INITNEW", /* 0x0378 */
519 "WM_QUEUE_SENTINEL", /* 0x0379 */
520 "WM_OCC_LOADFROMSTREAM_EX", /* 0x037A */
521 "WM_OCC_LOADFROMSTORAGE_EX", /* 0x037B */
533 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
536 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
537 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
545 NULL
, NULL
, NULL
, NULL
,
546 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
549 NULL
, NULL
, NULL
, NULL
, NULL
,
573 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
574 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
575 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
578 "WM_DDE_INITIATE", /* 0x3E0 */
579 "WM_DDE_TERMINATE", /* 0x3E1 */
580 "WM_DDE_ADVISE", /* 0x3E2 */
581 "WM_DDE_UNADVISE", /* 0x3E3 */
582 "WM_DDE_ACK", /* 0x3E4 */
583 "WM_DDE_DATA", /* 0x3E5 */
584 "WM_DDE_REQUEST", /* 0x3E6 */
585 "WM_DDE_POKE", /* 0x3E7 */
586 "WM_DDE_EXECUTE", /* 0x3E8 */
587 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
591 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
592 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
598 static BOOL16 SPY_Exclude
[SPY_MAX_MSGNUM
+1];
599 static BOOL16 SPY_ExcludeDWP
= 0;
600 static int SPY_IndentLevel
= 0;
602 #define SPY_EXCLUDE(msg) \
603 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
605 /***********************************************************************
608 const char *SPY_GetMsgName( UINT msg
)
610 static char msg_buffer
[20];
612 if (msg
<= SPY_MAX_MSGNUM
)
614 if (!MessageTypeNames
[msg
]) return "???";
615 return MessageTypeNames
[msg
];
617 sprintf( msg_buffer
, "WM_USER+%04x", msg
- WM_USER
);
621 /***********************************************************************
624 const char *SPY_GetWndName( HWND hwnd
)
626 static char wnd_buffer
[16];
628 WND
* pWnd
= WIN_FindWndPtr( hwnd
);
631 INT n
= sizeof(wnd_buffer
) - 6;
632 LPSTR p
= wnd_buffer
;
637 if( pWnd
->text
&& pWnd
->text
[0] != '\0' )
640 *(p
++) = postfix
= '\"';
641 while ((n
-- > 1) && *src
) *p
++ = *src
++;
643 else /* get class name */
648 GlobalGetAtomNameA( pWnd
->class->atomName
, p
, n
+ 1);
649 src
= p
+= (len
= lstrlenA(p
));
650 if( len
>= n
) src
= wnd_buffer
; /* something nonzero */
653 if( *src
) for( n
= 0; n
< 3; n
++ ) *(p
++)='.';
657 else lstrcpyA( wnd_buffer
, "\"NULL\"" );
661 /***********************************************************************
664 void SPY_EnterMessage( INT iFlag
, HWND hWnd
, UINT msg
,
665 WPARAM wParam
, LPARAM lParam
)
669 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
)) return;
671 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
674 case SPY_DISPATCHMESSAGE16
:
675 pname
= SPY_GetWndName(hWnd
);
676 TRACE(message
,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
677 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
681 case SPY_DISPATCHMESSAGE
:
682 pname
= SPY_GetWndName(hWnd
);
683 TRACE(message
,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
684 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
688 case SPY_SENDMESSAGE16
:
689 case SPY_SENDMESSAGE
:
692 HTASK16 hTask
= GetWindowTask16(hWnd
);
694 if (hTask
== GetCurrentTask()) strcpy( taskName
, "self" );
695 else if (!hTask
) strcpy( taskName
, "Wine" );
698 sprintf( taskName
, "task %04x ???", hTask
);
699 GetModuleName16( hTask
, taskName
+ 10, sizeof(taskName
) - 10 );
701 pname
= SPY_GetWndName(hWnd
);
703 if (iFlag
== SPY_SENDMESSAGE16
)
704 TRACE(message
, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
705 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
706 taskName
, wParam
, lParam
);
708 TRACE(message
, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
709 SPY_IndentLevel
, "", hWnd
, pname
, msg
, SPY_GetMsgName( msg
),
710 taskName
, wParam
, lParam
);
714 case SPY_DEFWNDPROC16
:
715 if( SPY_ExcludeDWP
) return;
716 TRACE(message
, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
717 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
718 msg
, wParam
, lParam
);
722 if( SPY_ExcludeDWP
) return;
723 TRACE(message
, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
724 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
725 msg
, wParam
, lParam
);
728 SPY_IndentLevel
+= SPY_INDENT_UNIT
;
732 /***********************************************************************
735 void SPY_ExitMessage( INT iFlag
, HWND hWnd
, UINT msg
, LRESULT lReturn
)
739 if (!TRACE_ON(message
) || SPY_EXCLUDE(msg
) ||
740 (SPY_ExcludeDWP
&& (iFlag
== SPY_RESULT_DEFWND16
|| iFlag
== SPY_RESULT_DEFWND
)) )
743 if (SPY_IndentLevel
) SPY_IndentLevel
-= SPY_INDENT_UNIT
;
747 case SPY_RESULT_DEFWND16
:
748 TRACE(message
," %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
749 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
752 case SPY_RESULT_DEFWND
:
753 TRACE(message
," %*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
754 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
), msg
, lReturn
);
757 case SPY_RESULT_OK16
:
758 pname
= SPY_GetWndName(hWnd
);
759 TRACE(message
," %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
760 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
761 SPY_GetMsgName( msg
), lReturn
);
765 pname
= SPY_GetWndName(hWnd
);
766 TRACE(message
," %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
767 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
768 SPY_GetMsgName( msg
), lReturn
);
771 case SPY_RESULT_INVALIDHWND16
:
772 pname
= SPY_GetWndName(hWnd
);
773 WARN(message
, " %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
774 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
775 SPY_GetMsgName( msg
) );
778 case SPY_RESULT_INVALIDHWND
:
779 pname
= SPY_GetWndName(hWnd
);
780 WARN(message
, " %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
781 SPY_IndentLevel
, "", hWnd
, pname
, msg
,
782 SPY_GetMsgName( msg
) );
788 /***********************************************************************
796 if (!TRACE_ON(message
)) return TRUE
;
798 PROFILE_GetWineIniString( "Spy", "Include", "", buffer
, sizeof(buffer
) );
799 if (buffer
[0] && strcmp( buffer
, "INCLUDEALL" ))
801 TRACE(message
, "Include=%s\n", buffer
);
802 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
803 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && !strstr(buffer
,MessageTypeNames
[i
]));
806 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer
, sizeof(buffer
) );
809 TRACE(message
, "Exclude=%s\n", buffer
);
810 if (!strcmp( buffer
, "EXCLUDEALL" ))
811 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++) SPY_Exclude
[i
] = TRUE
;
813 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
814 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && strstr(buffer
,MessageTypeNames
[i
]));
817 SPY_ExcludeDWP
= PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 );