2 * Message spying routines
4 * Copyright 1994, Bob Amstadt
8 #define NO_TRANSITION_TYPES /* This file is Win32-clean */
19 #define SPY_MAX_MSGNUM WM_USER
20 #define SPY_INDENT_UNIT 4 /* 4 spaces */
22 static const char * const MessageTypeNames
[SPY_MAX_MSGNUM
+ 1] =
40 "WM_CLOSE", /* 0x10 */
56 "WM_SETCURSOR", /* 0x20 */
72 "WM_SETFONT", /* 0x30 */
84 "wm_otherwindowcreated",
85 "wm_otherwindowdestroyed",
86 "wm_activateshellwindow",
90 "wm_compacting", NULL
, NULL
,
91 "WM_COMMNOTIFY", NULL
,
92 "WM_WINDOWPOSCHANGING", /* 0x0046 */
93 "WM_WINDOWPOSCHANGED", /* 0x0047 */
96 "WM_CANCELJOURNAL", NULL
, NULL
,
100 "WM_INPUTLANGCHANGEREQUEST",
101 "WM_INPUTLANGCHANGE",
105 "WM_NOTIFYFORMAT", NULL
, NULL
,
106 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
109 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
110 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
113 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
121 "WM_SETICON", /* 0x0080 */
122 "WM_NCCREATE", /* 0x0081 */
123 "WM_NCDESTROY", /* 0x0082 */
124 "WM_NCCALCSIZE", /* 0x0083 */
125 "WM_NCHITTEST", /* 0x0084 */
126 "WM_NCPAINT", /* 0x0085 */
127 "WM_NCACTIVATE", /* 0x0086 */
128 "WM_GETDLGCODE", /* 0x0087 */
130 "wm_synctask", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
133 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
134 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
137 "WM_NCMOUSEMOVE", /* 0x00A0 */
138 "WM_NCLBUTTONDOWN", /* 0x00A1 */
139 "WM_NCLBUTTONUP", /* 0x00A2 */
140 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
141 "WM_NCRBUTTONDOWN", /* 0x00A4 */
142 "WM_NCRBUTTONUP", /* 0x00A5 */
143 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
144 "WM_NCMBUTTONDOWN", /* 0x00A7 */
145 "WM_NCMBUTTONUP", /* 0x00A8 */
146 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
147 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
149 /* 0x00B0 - Win32 Edit controls */
150 "EM_GETSEL32", /* 0x00b0 */
151 "EM_SETSEL32", /* 0x00b1 */
152 "EM_GETRECT32", /* 0x00b2 */
153 "EM_SETRECT32", /* 0x00b3 */
154 "EM_SETRECTNP32", /* 0x00b4 */
155 "EM_SCROLL32", /* 0x00b5 */
156 "EM_LINESCROLL32", /* 0x00b6 */
157 "EM_SCROLLCARET32", /* 0x00b7 */
158 "EM_GETMODIFY32", /* 0x00b8 */
159 "EM_SETMODIFY32", /* 0x00b9 */
160 "EM_GETLINECOUNT32", /* 0x00ba */
161 "EM_LINEINDEX32", /* 0x00bb */
162 "EM_SETHANDLE32", /* 0x00bc */
163 "EM_GETHANDLE32", /* 0x00bd */
164 "EM_GETTHUMB32", /* 0x00be */
168 "EM_LINELENGTH32", /* 0x00c1 */
169 "EM_REPLACESEL32", /* 0x00c2 */
171 "EM_GETLINE32", /* 0x00c4 */
172 "EM_LIMITTEXT32", /* 0x00c5 */
173 "EM_CANUNDO32", /* 0x00c6 */
174 "EM_UNDO32", /* 0x00c7 */
175 "EM_FMTLINES32", /* 0x00c8 */
176 "EM_LINEFROMCHAR32", /* 0x00c9 */
178 "EM_SETTABSTOPS32", /* 0x00cb */
179 "EM_SETPASSWORDCHAR32", /* 0x00cc */
180 "EM_EMPTYUNDOBUFFER32", /* 0x00cd */
181 "EM_GETFIRSTVISIBLELINE32", /* 0x00ce */
182 "EM_SETREADONLY32", /* 0x00cf */
184 "EM_SETWORDBREAKPROC32", /* 0x00d0 */
185 "EM_GETWORDBREAKPROC32", /* 0x00d1 */
186 "EM_GETPASSWORDCHAR32", /* 0x00d2 */
187 "EM_SETMARGINS32", /* 0x00d3 */
188 "EM_GETMARGINS32", /* 0x00d4 */
189 "EM_GETLIMITTEXT32", /* 0x00d5 */
190 "EM_POSFROMCHAR32", /* 0x00d6 */
191 "EM_CHARFROMPOS32", /* 0x00d7 */
192 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
194 /* 0x00E0 - Win32 Scrollbars */
195 "SBM_SETPOS32", /* 0x00e0 */
196 "SBM_GETPOS32", /* 0x00e1 */
197 "SBM_SETRANGE32", /* 0x00e2 */
198 "SBM_GETRANGE32", /* 0x00e3 */
199 "SBM_ENABLE_ARROWS32", /* 0x00e4 */
201 "SBM_SETRANGEREDRAW32", /* 0x00e6 */
203 "SBM_SETSCROLLINFO32", /* 0x00e9 */
204 "SBM_GETSCROLLINFO32", /* 0x00ea */
205 NULL
, NULL
, NULL
, NULL
, NULL
,
207 /* 0x00F0 - Win32 Buttons */
208 "BM_GETCHECK32", /* 0x00f0 */
209 "BM_SETCHECK32", /* 0x00f1 */
210 "BM_GETSTATE32", /* 0x00f2 */
211 "BM_SETSTATE32", /* 0x00f3 */
212 "BM_SETSTYLE32", /* 0x00f4 */
213 "BM_CLICK32", /* 0x00f5 */
214 "BM_GETIMAGE32", /* 0x00f6 */
215 "BM_SETIMAGE32", /* 0x00f7 */
216 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
218 "WM_KEYDOWN", /* 0x0100 */
219 "WM_KEYUP", /* 0x0101 */
220 "WM_CHAR", /* 0x0102 */
221 "WM_DEADCHAR", /* 0x0103 */
222 "WM_SYSKEYDOWN", /* 0x0104 */
223 "WM_SYSKEYUP", /* 0x0105 */
224 "WM_SYSCHAR", /* 0x0106 */
225 "WM_SYSDEADCHAR", /* 0x0107 */
226 "WM_KEYLAST", /* 0x0108 */
230 "WM_INTERIM", NULL
, NULL
, NULL
,
232 "WM_INITDIALOG", /* 0x0110 */
233 "WM_COMMAND", /* 0x0111 */
234 "WM_SYSCOMMAND", /* 0x0112 */
235 "WM_TIMER", /* 0x0113 */
236 "WM_HSCROLL", /* 0x0114 */
237 "WM_VSCROLL", /* 0x0115 */
238 "WM_INITMENU", /* 0x0116 */
239 "WM_INITMENUPOPUP", /* 0x0117 */
240 "WM_SYSTIMER", /* 0x0118 */
241 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
242 "WM_MENUSELECT", /* 0x011f */
244 "WM_MENUCHAR", /* 0x0120 */
245 "WM_ENTERIDLE", /* 0x0121 */
246 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
247 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
251 "wm_lbtrackpoint", /* 0x0131 */
252 "WM_CTLCOLORMSGBOX", /* 0x0132 */
253 "WM_CTLCOLOREDIT", /* 0x0133 */
254 "WM_CTLCOLORLISTBOX", /* 0x0134 */
255 "WM_CTLCOLORBTN", /* 0x0135 */
256 "WM_CTLCOLORDLG", /* 0x0136 */
257 "WM_CTLCOLORSCROLLBAR", /* 0x0137 */
258 "WM_CTLCOLORSTATIC", /* 0x0138 */
259 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
261 /* 0x0140 - Win32 Comboboxes */
262 "CB_GETEDITSEL32", /* 0x0140 */
263 "CB_LIMITTEXT32", /* 0x0141 */
264 "CB_SETEDITSEL32", /* 0x0142 */
265 "CB_ADDSTRING32", /* 0x0143 */
266 "CB_DELETESTRING32", /* 0x0144 */
267 "CB_DIR32", /* 0x0145 */
268 "CB_GETCOUNT32", /* 0x0146 */
269 "CB_GETCURSEL32", /* 0x0147 */
270 "CB_GETLBTEXT32", /* 0x0148 */
271 "CB_GETLBTEXTLEN32", /* 0x0149 */
272 "CB_INSERTSTRING32", /* 0x014a */
273 "CB_RESETCONTENT32", /* 0x014b */
274 "CB_FINDSTRING32", /* 0x014c */
275 "CB_SELECTSTRING32", /* 0x014d */
276 "CB_SETCURSEL32", /* 0x014e */
277 "CB_SHOWDROPDOWN32", /* 0x014f */
279 "CB_GETITEMDATA32", /* 0x0150 */
280 "CB_SETITEMDATA32", /* 0x0151 */
281 "CB_GETDROPPEDCONTROLRECT32",/* 0x0152 */
282 "CB_SETITEMHEIGHT32", /* 0x0153 */
283 "CB_GETITEMHEIGHT32", /* 0x0154 */
284 "CB_SETEXTENDEDUI32", /* 0x0155 */
285 "CB_GETEXTENDEDUI32", /* 0x0156 */
286 "CB_GETDROPPEDSTATE32", /* 0x0157 */
287 "CB_FINDSTRINGEXACT32", /* 0x0158 */
288 "CB_SETLOCALE32", /* 0x0159 */
289 "CB_GETLOCALE32", /* 0x015a */
290 "CB_GETTOPINDEX32", /* 0x015b */
291 "CB_SETTOPINDEX32", /* 0x015c */
292 "CB_GETHORIZONTALEXTENT32", /* 0x015d */
293 "CB_SETHORIZONTALEXTENT32", /* 0x015e */
294 "CB_GETDROPPEDWIDTH32", /* 0x015f */
296 "CB_SETDROPPEDWIDTH32", /* 0x0160 */
297 "CB_INITSTORAGE32", /* 0x0161 */
298 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
299 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
301 /* 0x0170 - Win32 Static controls */
302 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
303 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
305 /* 0x0180 - Win32 Listboxes */
306 "LB_ADDSTRING32", /* 0x0180 */
307 "LB_INSERTSTRING32", /* 0x0181 */
308 "LB_DELETESTRING32", /* 0x0182 */
309 "LB_SELITEMRANGEEX32", /* 0x0183 */
310 "LB_RESETCONTENT32", /* 0x0184 */
311 "LB_SETSEL32", /* 0x0185 */
312 "LB_SETCURSEL32", /* 0x0186 */
313 "LB_GETSEL32", /* 0x0187 */
314 "LB_GETCURSEL32", /* 0x0188 */
315 "LB_GETTEXT32", /* 0x0189 */
316 "LB_GETTEXTLEN32", /* 0x018a */
317 "LB_GETCOUNT32", /* 0x018b */
318 "LB_SELECTSTRING32", /* 0x018c */
319 "LB_DIR32", /* 0x018d */
320 "LB_GETTOPINDEX32", /* 0x018e */
321 "LB_FINDSTRING32", /* 0x018f */
323 "LB_GETSELCOUNT32", /* 0x0190 */
324 "LB_GETSELITEMS32", /* 0x0191 */
325 "LB_SETTABSTOPS32", /* 0x0192 */
326 "LB_GETHORIZONTALEXTENT32", /* 0x0193 */
327 "LB_SETHORIZONTALEXTENT32", /* 0x0194 */
328 "LB_SETCOLUMNWIDTH32", /* 0x0195 */
329 "LB_ADDFILE32", /* 0x0196 */
330 "LB_SETTOPINDEX32", /* 0x0197 */
331 "LB_GETITEMRECT32", /* 0x0198 */
332 "LB_GETITEMDATA32", /* 0x0199 */
333 "LB_SETITEMDATA32", /* 0x019a */
334 "LB_SELITEMRANGE32", /* 0x019b */
335 "LB_SETANCHORINDEX32", /* 0x019c */
336 "LB_GETANCHORINDEX32", /* 0x019d */
337 "LB_SETCARETINDEX32", /* 0x019e */
338 "LB_GETCARETINDEX32", /* 0x019f */
340 "LB_SETITEMHEIGHT32", /* 0x01a0 */
341 "LB_GETITEMHEIGHT32", /* 0x01a1 */
342 "LB_FINDSTRINGEXACT32", /* 0x01a2 */
343 "LB_CARETON32", /* 0x01a3 */
344 "LB_CARETOFF32", /* 0x01a4 */
345 "LB_SETLOCALE32", /* 0x01a5 */
346 "LB_GETLOCALE32", /* 0x01a6 */
347 "LB_SETCOUNT32", /* 0x01a7 */
348 "LB_INITSTORAGE32", /* 0x01a8 */
349 "LB_ITEMFROMPOINT32", /* 0x01a9 */
350 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
353 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
354 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
357 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
358 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
361 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
362 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
365 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
366 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
369 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
370 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
372 "WM_MOUSEMOVE", /* 0x0200 */
373 "WM_LBUTTONDOWN", /* 0x0201 */
374 "WM_LBUTTONUP", /* 0x0202 */
375 "WM_LBUTTONDBLCLK", /* 0x0203 */
376 "WM_RBUTTONDOWN", /* 0x0204 */
377 "WM_RBUTTONUP", /* 0x0205 */
378 "WM_RBUTTONDBLCLK", /* 0x0206 */
379 "WM_MBUTTONDOWN", /* 0x0207 */
380 "WM_MBUTTONUP", /* 0x0208 */
381 "WM_MBUTTONDBLCLK", /* 0x0209 */
382 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
384 "WM_PARENTNOTIFY", /* 0x0210 */
385 "WM_ENTERMENULOOP", /* 0x0211 */
386 "WM_EXITMENULOOP", /* 0x0212 */
387 "wm_nextmenu", /* 0x0213 */
392 "WM_DEVICECHANGE", NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
394 "WM_MDICREATE", /* 0x0220 */
395 "WM_MDIDESTROY", /* 0x0221 */
396 "WM_MDIACTIVATE", /* 0x0222 */
397 "WM_MDIRESTORE", /* 0x0223 */
398 "WM_MDINEXT", /* 0x0224 */
399 "WM_MDIMAXIMIZE", /* 0x0225 */
400 "WM_MDITILE", /* 0x0226 */
401 "WM_MDICASCADE", /* 0x0227 */
402 "WM_MDIICONARRANGE", /* 0x0228 */
403 "WM_MDIGETACTIVE", /* 0x0229 */
406 "wm_querydropobject",
413 "WM_MDISETMENU", /* 0x0230 */
414 "WM_ENTERSIZEMOVE", /* 0x0231 */
415 "WM_EXITSIZEMOVE", /* 0x0232 */
416 "WM_DROPFILES", /* 0x0233 */
417 "WM_MDIREFRESHMENU", NULL
, NULL
, NULL
,
419 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
422 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
423 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
426 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
427 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
430 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
,
433 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
,
439 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
,
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
,
450 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 "WM_CUT", /* 0x0300 */
463 "WM_RENDERALLFORMATS",
464 "WM_DESTROYCLIPBOARD",
467 "WM_VSCROLLCLIPBOARD",
469 "WM_ASKCBFORMATNAME",
471 "WM_HSCROLLCLIPBOARD",
472 "WM_QUERYNEWPALETTE", /* 0x030f*/
474 "WM_PALETTEISCHANGING",
476 "WM_HOTKEY", /* 0x0312 */
477 NULL
, NULL
, NULL
, NULL
,
480 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
482 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
483 NULL
, 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
,
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
,
491 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
,
506 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
509 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
510 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
513 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
514 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
515 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
516 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
519 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
520 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
521 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
522 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
525 "WM_DDE_INITIATE", /* 0x3E0 */
526 "WM_DDE_TERMINATE", /* 0x3E1 */
527 "WM_DDE_ADVISE", /* 0x3E2 */
528 "WM_DDE_UNADVISE", /* 0x3E3 */
529 "WM_DDE_ACK", /* 0x3E4 */
530 "WM_DDE_DATA", /* 0x3E5 */
531 "WM_DDE_REQUEST", /* 0x3E6 */
532 "WM_DDE_POKE", /* 0x3E7 */
533 "WM_DDE_EXECUTE", /* 0x3E8 */
534 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
538 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
539 NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
545 static BOOL16 SPY_Exclude
[SPY_MAX_MSGNUM
+1];
546 static int SPY_IndentLevel
= 0;
548 #define SPY_EXCLUDE(msg) \
549 (SPY_Exclude[(msg) > SPY_MAX_MSGNUM ? SPY_MAX_MSGNUM : (msg)])
551 /***********************************************************************
554 const char *SPY_GetMsgName( UINT32 msg
)
556 static char buffer
[20];
558 if (msg
<= SPY_MAX_MSGNUM
)
560 if (!MessageTypeNames
[msg
]) return "???";
561 return MessageTypeNames
[msg
];
563 sprintf( buffer
, "WM_USER+%04x", msg
- WM_USER
);
568 /***********************************************************************
571 void SPY_EnterMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
,
572 WPARAM32 wParam
, LPARAM lParam
)
574 if (!debugging_message
|| SPY_EXCLUDE(msg
)) return;
576 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
579 case SPY_DISPATCHMESSAGE16
:
580 dprintf_message(stddeb
,"%*s(%04x) message [%04x] %s dispatched wp=%04x lp=%08lx\n",
581 SPY_IndentLevel
, "", hWnd
, msg
, SPY_GetMsgName( msg
),
585 case SPY_DISPATCHMESSAGE32
:
586 dprintf_message(stddeb
,"%*s(%08x) message [%04x] %s dispatched wp=%08x lp=%08lx\n",
587 SPY_IndentLevel
, "", hWnd
, msg
, SPY_GetMsgName( msg
),
591 case SPY_SENDMESSAGE16
:
592 case SPY_SENDMESSAGE32
:
595 HTASK16 hTask
= GetWindowTask16(hWnd
);
596 if (hTask
== GetCurrentTask()) strcpy( taskName
, "self" );
597 else if (!hTask
) strcpy( taskName
, "Wine" );
598 else sprintf( taskName
, "task %04x %s",
599 hTask
, MODULE_GetModuleName( GetExePtr(hTask
) ) );
601 if (iFlag
== SPY_SENDMESSAGE16
)
602 dprintf_message(stddeb
,"%*s(%04x) message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
603 SPY_IndentLevel
, "", hWnd
, msg
,
604 SPY_GetMsgName( msg
), taskName
, wParam
,
607 dprintf_message(stddeb
,"%*s(%08x) message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
608 SPY_IndentLevel
, "", hWnd
, msg
,
609 SPY_GetMsgName( msg
), taskName
, wParam
,
614 case SPY_DEFWNDPROC16
:
615 dprintf_message(stddeb
, "%*s(%04x) DefWindowProc: %s [%04x] wp=%04x lp=%08lx\n",
616 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
617 msg
, wParam
, lParam
);
620 case SPY_DEFWNDPROC32
:
621 dprintf_message(stddeb
, "%*s(%08x) DefWindowProc: %s [%04x] wp=%08x lp=%08lx\n",
622 SPY_IndentLevel
, "", hWnd
, SPY_GetMsgName( msg
),
623 msg
, wParam
, lParam
);
626 SPY_IndentLevel
+= SPY_INDENT_UNIT
;
630 /***********************************************************************
633 void SPY_ExitMessage( INT32 iFlag
, HWND32 hWnd
, UINT32 msg
, LRESULT lReturn
)
635 if (!debugging_message
|| SPY_EXCLUDE(msg
)) return;
636 if (SPY_IndentLevel
) SPY_IndentLevel
-= SPY_INDENT_UNIT
;
640 case SPY_RESULT_OK16
:
641 dprintf_message(stddeb
,"%*s(%04x) message [%04x] %s returned %08lx\n",
642 SPY_IndentLevel
, "", hWnd
, msg
,
643 SPY_GetMsgName( msg
), lReturn
);
645 case SPY_RESULT_OK32
:
646 dprintf_message(stddeb
,"%*s(%08x) message [%04x] %s returned %08lx\n",
647 SPY_IndentLevel
, "", hWnd
, msg
,
648 SPY_GetMsgName( msg
), lReturn
);
650 case SPY_RESULT_INVALIDHWND16
:
651 dprintf_message(stddeb
,"%*s(%04x) message [%04x] %s HAS INVALID HWND\n",
652 SPY_IndentLevel
, "", hWnd
, msg
,
653 SPY_GetMsgName( msg
) );
655 case SPY_RESULT_INVALIDHWND32
:
656 dprintf_message(stddeb
,"%*s(%08x) message [%04x] %s HAS INVALID HWND\n",
657 SPY_IndentLevel
, "", hWnd
, msg
,
658 SPY_GetMsgName( msg
) );
664 /***********************************************************************
672 PROFILE_GetWineIniString( "Spy", "Include", "", buffer
, sizeof(buffer
) );
673 if (buffer
[0] && strcmp( buffer
, "INCLUDEALL" ))
675 dprintf_message( stddeb
, "SpyInit: Include=%s\n", buffer
);
676 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
677 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && !strstr(buffer
,MessageTypeNames
[i
]));
680 PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer
, sizeof(buffer
) );
683 dprintf_message( stddeb
, "SpyInit: Exclude=%s\n", buffer
);
684 if (!strcmp( buffer
, "EXCLUDEALL" ))
685 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++) SPY_Exclude
[i
] = TRUE
;
687 for (i
= 0; i
<= SPY_MAX_MSGNUM
; i
++)
688 SPY_Exclude
[i
] = (MessageTypeNames
[i
] && strstr(buffer
,MessageTypeNames
[i
]));