Release 960114
[wine/gsoc-2012-control.git] / misc / spy.c
blob3a92d62a0b4fc6af887b710dabe9ad7217fcede6
1 /* SPY.C
3 * Copyright 1994, Bob Amstadt
4 * 1995, Alex Korobka
5 */
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include <X11/Xlib.h>
10 #include <X11/Xresource.h>
11 #include <string.h>
12 #include "windows.h"
13 #include "wine.h"
14 #include "options.h"
15 #include "stddebug.h"
16 #include "debug.h"
17 #include "spy.h"
19 #define SPY_MAX_MSGNUM WM_USER
20 #define SPY_MAX_INDENTLEVEL 64
22 const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
24 "WM_NULL", /* 0x00 */
25 "WM_CREATE",
26 "WM_DESTROY",
27 "WM_MOVE",
28 "WM_SIZEWAIT",
29 "WM_SIZE",
30 "WM_ACTIVATE",
31 "WM_SETFOCUS",
32 "WM_KILLFOCUS",
33 "WM_SETVISIBLE",
34 "WM_ENABLE",
35 "WM_SETREDRAW",
36 "WM_SETTEXT",
37 "WM_GETTEXT",
38 "WM_GETTEXTLENGTH",
39 "WM_PAINT",
40 "WM_CLOSE", /* 0x10 */
41 "WM_QUERYENDSESSION",
42 "WM_QUIT",
43 "WM_QUERYOPEN",
44 "WM_ERASEBKGND",
45 "WM_SYSCOLORCHANGE",
46 "WM_ENDSESSION",
47 "WM_SYSTEMERROR",
48 "WM_SHOWWINDOW",
49 "WM_CTLCOLOR",
50 "WM_WININICHANGE",
51 "WM_DEVMODECHANGE",
52 "WM_ACTIVATEAPP",
53 "WM_FONTCHANGE",
54 "WM_TIMECHANGE",
55 "WM_CANCELMODE",
56 "WM_SETCURSOR", /* 0x20 */
57 "WM_MOUSEACTIVATE",
58 "WM_CHILDACTIVATE",
59 "WM_QUEUESYNC",
60 "WM_GETMINMAXINFO",
61 "WM_UNUSED3",
62 "WM_PAINTICON",
63 "WM_ICONERASEBKGND",
64 "WM_NEXTDLGCTL",
65 "WM_ALTTABACTIVE",
66 "WM_SPOOLERSTATUS",
67 "WM_DRAWITEM",
68 "WM_MEASUREITEM",
69 "WM_DELETEITEM",
70 "WM_VKEYTOITEM",
71 "WM_CHARTOITEM",
72 "WM_SETFONT", /* 0x30 */
73 "WM_GETFONT",
74 "WM_SETHOTKEY",
75 "WM_GETHOTKEY",
76 "WM_FILESYSCHANGE",
77 "WM_ISACTIVEICON",
78 "WM_QUERYPARKICON",
79 "WM_QUERYDRAGICON",
80 "WM_QUERYSAVESTATE",
81 "WM_COMPAREITEM",
82 "WM_TESTING", NULL,
83 "WM_OTHERWINDOWCREATED",
84 "WM_OTHERWINDOWDESTROYED",
85 "WM_ACTIVATESHELLWINDOW", NULL,
87 NULL, /* 0x40 */
88 "WM_COMPACTING", NULL, NULL,
89 "WM_COMMNOTIFY", NULL,
90 "WM_WINDOWPOSCHANGING", /* 0x0046 */
91 "WM_WINDOWPOSCHANGED", /* 0x0047 */
92 "WM_POWER", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
94 NULL, /* 0x0050 */
95 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
96 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
98 /* 0x0060 */
99 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
100 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
102 /* 0x0070 */
103 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
104 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
106 NULL, /* 0x0080 */
107 "WM_NCCREATE", /* 0x0081 */
108 "WM_NCDESTROY", /* 0x0082 */
109 "WM_NCCALCSIZE", /* 0x0083 */
110 "WM_NCHITTEST", /* 0x0084 */
111 "WM_NCPAINT", /* 0x0085 */
112 "WM_NCACTIVATE", /* 0x0086 */
113 "WM_GETDLGCODE", /* 0x0087 */
114 "WM_SYNCPAINT",
115 "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL,
117 /* 0x0090 */
118 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
119 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
121 /* 0x00A0 */
122 "WM_NCMOUSEMOVE", /* 0x00A0 */
123 "WM_NCLBUTTONDOWN", /* 0x00A1 */
124 "WM_NCLBUTTONUP", /* 0x00A2 */
125 "WM_NCLBUTTONDBLCLK", /* 0x00A3 */
126 "WM_NCRBUTTONDOWN", /* 0x00A4 */
127 "WM_NCRBUTTONUP", /* 0x00A5 */
128 "WM_NCRBUTTONDBLCLK", /* 0x00A6 */
129 "WM_NCMBUTTONDOWN", /* 0x00A7 */
130 "WM_NCMBUTTONUP", /* 0x00A8 */
131 "WM_NCMBUTTONDBLCLK", /* 0x00A9 */
132 NULL, NULL, NULL, NULL, NULL, NULL,
134 /* 0x00B0 */
135 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
136 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
138 /* 0x00C0 */
139 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
140 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
142 /* 0x00D0 */
143 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
144 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
146 /* 0x00E0 */
147 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
148 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
150 /* 0x00F0 */
151 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
152 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
154 "WM_KEYDOWN", /* 0x0100 */
155 "WM_KEYUP", /* 0x0101 */
156 "WM_CHAR", /* 0x0102 */
157 "WM_DEADCHAR", /* 0x0103 */
158 "WM_SYSKEYDOWN", /* 0x0104 */
159 "WM_SYSKEYUP", /* 0x0105 */
160 "WM_SYSCHAR", /* 0x0106 */
161 "WM_SYSDEADCHAR", /* 0x0107 */
162 "WM_KEYLAST", /* 0x0108 */
163 NULL,
164 "WM_CONVERTREQUEST",
165 "WM_CONVERTRESULT",
166 "WM_INTERIM", NULL, NULL, NULL,
168 "WM_INITDIALOG", /* 0x0110 */
169 "WM_COMMAND", /* 0x0111 */
170 "WM_SYSCOMMAND", /* 0x0112 */
171 "WM_TIMER", /* 0x0113 */
172 "WM_HSCROLL", /* 0x0114 */
173 "WM_VSCROLL", /* 0x0115 */
174 "WM_INITMENU", /* 0x0116 */
175 "WM_INITMENUPOPUP", /* 0x0117 */
176 "WM_SYSTIMER", /* 0x0118 */
177 NULL, NULL, NULL, NULL, NULL, NULL,
178 "WM_MENUSELECT", /* 0x011f */
180 "WM_MENUCHAR", /* 0x0120 */
181 "WM_ENTERIDLE", /* 0x0121 */
182 NULL, NULL, NULL, NULL, NULL, NULL,
183 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
185 /* 0x0130 */
186 NULL, "wm_lbtrackpoint",
187 NULL, NULL, NULL, NULL, NULL, NULL,
188 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
190 /* 0x0140 */
191 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
192 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
194 /* 0x0150 */
195 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
196 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
198 /* 0x0160 */
199 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
200 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
202 /* 0x0170 */
203 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
204 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
206 /* 0x0180 */
207 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
208 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
210 /* 0x0190 */
211 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
212 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
214 /* 0x01A0 */
215 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
216 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
218 /* 0x01B0 */
219 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
220 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
222 /* 0x01C0 */
223 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
224 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
226 /* 0x01D0 */
227 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
228 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
230 /* 0x01E0 */
231 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
232 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
234 /* 0x01F0 */
235 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
236 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
238 "WM_MOUSEMOVE", /* 0x0200 */
239 "WM_LBUTTONDOWN", /* 0x0201 */
240 "WM_LBUTTONUP", /* 0x0202 */
241 "WM_LBUTTONDBLCLK", /* 0x0203 */
242 "WM_RBUTTONDOWN", /* 0x0204 */
243 "WM_RBUTTONUP", /* 0x0205 */
244 "WM_RBUTTONDBLCLK", /* 0x0206 */
245 "WM_MBUTTONDOWN", /* 0x0207 */
246 "WM_MBUTTONUP", /* 0x0208 */
247 "WM_MBUTTONDBLCLK", /* 0x0209 */
248 NULL, NULL, NULL, NULL, NULL, NULL,
250 "WM_PARENTNOTIFY", /* 0x0210 */
251 "WM_ENTERMENULOOP", /* 0x0211 */
252 "WM_EXITMENULOOP", /* 0x0212 */
253 "WM_NEXTMENU", /* 0x0213 */
254 NULL, NULL, NULL, NULL,
255 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
257 "WM_MDICREATE", /* 0x0220 */
258 "WM_MDIDESTROY", /* 0x0221 */
259 "WM_MDIACTIVATE", /* 0x0222 */
260 "WM_MDIRESTORE", /* 0x0223 */
261 "WM_MDINEXT", /* 0x0224 */
262 "WM_MDIMAXIMIZE", /* 0x0225 */
263 "WM_MDITILE", /* 0x0226 */
264 "WM_MDICASCADE", /* 0x0227 */
265 "WM_MDIICONARRANGE", /* 0x0228 */
266 "WM_MDIGETACTIVE", /* 0x0229 */
268 "wm_dropobject",
269 "wm_querydropobject",
270 "wm_begindrag",
271 "wm_dragloop",
272 "wn_dragselect",
273 "wm_dragmove",
275 /* 0x0230*/
276 "WM_MDISETMENU", /* 0x0230 */
277 "WM_ENTERSIZEMOVE", /* 0x0231 */
278 "WM_EXITSIZEMOVE", /* 0x0232 */
279 "WM_DROPFILES", /* 0x0233 */
280 NULL, NULL, NULL, NULL,
281 /* 0x0238*/
282 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
284 /* 0x0240 */
285 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
286 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
288 /* 0x0250 */
289 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
290 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
292 /* 0x0260 */
293 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
294 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
295 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
296 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
298 /* 0x0280 */
299 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
300 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
301 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
302 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
304 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
305 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
306 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
307 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
309 /* 0x02c0 */
310 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
311 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
312 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
313 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
315 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
316 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
317 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
318 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
320 "WM_CUT", /* 0x0300 */
321 "WM_COPY",
322 "WM_PASTE",
323 "WM_CLEAR",
324 "WM_UNDO",
325 "WM_RENDERFORMAT",
326 "WM_RENDERALLFORMATS",
327 "WM_DESTROYCLIPBOARD",
328 "WM_DRAWCLIPBOARD",
329 "WM_PAINTCLIPBOARD",
330 "WM_VSCROLLCLIPBOARD",
331 "WM_SIZECLIPBOARD",
332 "WM_ASKCBFORMATNAME",
333 "WM_CHANGECBCHAIN",
334 "WM_HSCROLLCLIPBOARD",
335 "WM_QUERYNEWPALETTE", /* 0x030f*/
337 "WM_PALETTEISCHANGING",
338 "WM_PALETTECHANGED", /* 0x0311 */
339 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
340 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
342 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
343 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
344 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
345 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
347 /* 0x0340 */
348 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
349 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
350 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
351 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
353 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
354 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
355 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
356 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
358 /* 0x0380 */
359 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
360 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
362 "WM_COALESCE_FIRST",
363 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
364 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
365 "WM_COALESCE_LAST",
367 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,
370 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
372 /* 0x03c0 */
373 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,
376 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
378 /* 0x03e0 */
379 "WM_DDE_INITIATE", /* 0x3E0 */
380 "WM_DDE_TERMINATE", /* 0x3E1 */
381 "WM_DDE_ADVISE", /* 0x3E2 */
382 "WM_DDE_UNADVISE", /* 0x3E3 */
383 "WM_DDE_ACK", /* 0x3E4 */
384 "WM_DDE_DATA", /* 0x3E5 */
385 "WM_DDE_REQUEST", /* 0x3E6 */
386 "WM_DDE_POKE", /* 0x3E7 */
387 "WM_DDE_EXECUTE", /* 0x3E8 */
388 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
391 /* 0x03f0 */
392 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
393 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
395 "WM_USER"
398 static BOOL SpyFilters [SPY_MAX_MSGNUM+1];
399 static BOOL SpyIncludes[SPY_MAX_MSGNUM+1];
401 static int iSpyMessageIndentLevel = 0;
402 static char lpstrSpyMessageIndent[SPY_MAX_INDENTLEVEL];
403 static char *lpstrSpyMessageFromWine = "Wine";
404 static char lpstrSpyMessageFromTask[10];
405 static char *lpstrSpyMessageFromSelf = "self";
406 static char *lpstrSpyMessageFrom = NULL;
409 /**********************************************************************
410 * EnterSpyMessage
412 void EnterSpyMessage(int iFlag, HWND hWnd, WORD msg, WORD wParam, LONG lParam)
414 HTASK hTask = GetWindowTask(hWnd);
415 WORD wCheckMsg = (msg > WM_USER)? WM_USER: msg;
417 if( !SpyIncludes[wCheckMsg] || SpyFilters[wCheckMsg]) return;
419 /* each SPY_SENDMESSAGE must be complemented by call to ExitSpyMessage */
420 switch(iFlag)
422 case SPY_DISPATCHMESSAGE:
423 if(msg <= WM_USER)
425 if(MessageTypeNames[msg])
426 dprintf_message(stddeb,"("NPFMT") message [%04x] %s dispatched wp=%04x lp=%08lx\n",
427 hWnd, msg, MessageTypeNames[msg], wParam, lParam);
428 else
429 dprintf_message(stddeb,"("NPFMT") message [%04x] dispatched wp=%04x lp=%08lx\n",
430 hWnd, msg, wParam, lParam);
432 else
433 dprintf_message(stddeb,"("NPFMT") message [%04x] WM_USER+%04d dispatched wp=%04x lp=%08lx\n",
434 hWnd, msg, msg-WM_USER ,wParam ,lParam);
435 break;
436 case SPY_SENDMESSAGE:
437 if(hTask == GetCurrentTask())
438 lpstrSpyMessageFrom = lpstrSpyMessageFromSelf;
439 else if(hTask == NULL)
440 lpstrSpyMessageFrom = lpstrSpyMessageFromWine;
441 else
443 sprintf(lpstrSpyMessageFromTask, "task "NPFMT, hTask);
444 lpstrSpyMessageFrom = lpstrSpyMessageFromTask;
447 if(msg <= WM_USER)
449 if(MessageTypeNames[msg])
450 dprintf_message(stddeb,"%s("NPFMT") message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
451 lpstrSpyMessageIndent,
452 hWnd, msg, MessageTypeNames[msg],
453 lpstrSpyMessageFrom,
454 wParam, lParam);
455 else
456 dprintf_message(stddeb,"%s("NPFMT") message [%04x] sent from %s wp=%04x lp=%08lx\n",
457 lpstrSpyMessageIndent,
458 hWnd, msg,
459 lpstrSpyMessageFrom,
460 wParam, lParam);
462 else
463 dprintf_message(stddeb,"%s("NPFMT") message [%04x] WM_USER+%04x sent from %s wp=%04x lp=%08lx\n",
464 lpstrSpyMessageIndent,
465 hWnd, msg, msg-WM_USER,
466 lpstrSpyMessageFrom,
467 wParam, lParam);
469 if(SPY_MAX_INDENTLEVEL > iSpyMessageIndentLevel )
471 iSpyMessageIndentLevel++;
472 lpstrSpyMessageIndent[iSpyMessageIndentLevel]='\0';
473 lpstrSpyMessageIndent[iSpyMessageIndentLevel-1] ='\t';
475 break;
476 case SPY_DEFWNDPROC:
477 if(msg <= WM_USER)
478 if(MessageTypeNames[msg])
479 dprintf_message(stddeb, "%s("NPFMT") DefWindowProc: %s [%04x] wp=%04x lp=%08lx\n",
480 lpstrSpyMessageIndent,
481 hWnd, MessageTypeNames[msg], msg, wParam, lParam );
482 else
483 dprintf_message(stddeb, "%s("NPFMT") DefWindowProc: [%04x] wp=%04x lp=%08lx\n",
484 lpstrSpyMessageIndent,
485 hWnd, msg, wParam, lParam );
486 else
487 dprintf_message(stddeb, "%s("NPFMT") DefWindowProc: WM_USER+%d [%04x] wp=%04x lp=%08lx\n",
488 lpstrSpyMessageIndent,
489 hWnd, msg - WM_USER, msg, wParam, lParam );
490 break;
491 default:
496 /**********************************************************************
497 * ExitSpyMessage
499 void ExitSpyMessage(int iFlag, HWND hWnd, WORD msg, LONG lReturn)
501 WORD wCheckMsg = (msg > WM_USER)? WM_USER: msg;
503 if( !SpyIncludes[wCheckMsg] || SpyFilters[wCheckMsg]) return;
505 iSpyMessageIndentLevel--;
506 lpstrSpyMessageIndent[iSpyMessageIndentLevel]='\0';
508 switch(iFlag)
510 case SPY_RESULT_INVALIDHWND:
511 dprintf_message(stddeb,"%s("NPFMT") message [%04x] HAS INVALID HWND\n",
512 lpstrSpyMessageIndent, hWnd, msg);
513 break;
514 case SPY_RESULT_OK:
515 dprintf_message(stddeb,"%s("NPFMT") message [%04x] returned %08lx\n",
516 lpstrSpyMessageIndent, hWnd, msg, lReturn);
517 break;
518 default:
522 /**********************************************************************
523 * SpyInit
525 void SpyInit(void)
527 int i;
528 char lpstrBuffer[512];
530 for(i=0; i <= SPY_MAX_MSGNUM; i++) SpyFilters[i] = SpyIncludes[i] = FALSE;
532 GetPrivateProfileString("spy", "Exclude", "",lpstrBuffer ,511 , WINE_INI);
533 dprintf_message(stddeb,"SpyInit: Exclude=%s\n",lpstrBuffer);
534 if( *lpstrBuffer != 0 )
535 if(strstr(lpstrBuffer,"EXCLUDEALL"))
536 for(i=0; i <= SPY_MAX_MSGNUM; i++) SpyFilters[i] = TRUE;
537 else
538 for(i=0; i <= SPY_MAX_MSGNUM; i++)
539 if(MessageTypeNames[i])
540 if(strstr(lpstrBuffer,MessageTypeNames[i])) SpyFilters[i] = TRUE;
542 GetPrivateProfileString("spy", "Include", "INCLUDEALL",lpstrBuffer ,511 , WINE_INI);
543 dprintf_message(stddeb,"SpyInit: Include=%s\n",lpstrBuffer);
544 if( *lpstrBuffer != 0 )
545 if(strstr(lpstrBuffer,"INCLUDEALL"))
546 for(i=0; i <= SPY_MAX_MSGNUM; i++) SpyIncludes[i] = TRUE;
547 else
548 for(i=0; i <= SPY_MAX_MSGNUM; i++)
549 if(MessageTypeNames[i])
550 if(strstr(lpstrBuffer,MessageTypeNames[i])) SpyIncludes[i] = TRUE;