home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / sharewar / winbatch / winbatch.exe / analysis.wb_ next >
Encoding:
Text File  |  2000-12-13  |  3.4 KB  |  123 lines

  1. ; This script creates a report on the windows visible at the time
  2. ; the report is run.  Run the script.  Choose a top-level
  3. ; window of interest, and it will show pertainent information
  4. ; that may be necessary to use the Control Manager extender.
  5.  
  6. ; Note that Tabbed dialogs sometimes must be displayed before
  7. ; their controls are brought into existance.  So when using
  8. ; tabbed dialogs, tab to the correct dialog first.  The
  9. ; cWndInfo example shows how to move thru a tabbed dialog.
  10.  
  11. AddExtender("wwctl34i.dll")
  12. verx=cGetInfo(0)
  13. fname="trash.txt"
  14.  
  15. a=WinItemize()
  16. b=AskItemList("Choose a Window",a,@tab,@unsorted,@single)
  17. hwnd=DllHwnd(b)
  18. myfile=FileOpen(fname,"WRITE")
  19.  
  20. workwnd=hwnd
  21. gosub gettextandclass
  22. FileWrite(myfile,"Control Manager version %verx%")
  23. FileWrite(myfile,"")
  24. FileWrite(myfile,"")
  25. FileWrite(myfile,"P   C   C   C   C")
  26. FileWrite(myfile,"A   H   H   H   H")
  27. FileWrite(myfile,"R   I   I   I   I")
  28. FileWrite(myfile,"E   L   L   L   L")
  29. FileWrite(myfile,"N   D   D   D   D")
  30. FileWrite(myfile,strcat(strfix("T   2   3   4   5"," ",21),strfix("CLASS"," ",26),strfix("IDENT"," ",7),"TITLE"))
  31.  
  32. FileWrite(myfile,strfill("-",80))
  33. FileWrite(myfile,strcat(strfix("TOP"," ",21),strfix(class," ",26),strfix(ident," ",7),text))
  34.  
  35. gosub ProcessChildren
  36. FileClose(myfile)
  37.  
  38. Run("notepad.exe",fname)
  39. exit
  40.  
  41. :ProcessChildren
  42. nextchild=cWndInfo(workwnd,8)
  43. ChildCount=0
  44. if nextchild==0
  45.    FileWrite(myfile,"    X                NONE")
  46. else
  47.    while nextchild
  48.        ChildCount=ChildCount+1
  49.        workwnd=nextchild
  50.        gosub gettextandclass
  51.        FileWrite(myfile," ")
  52.        FileWrite(myfile,strcat("    ",strfix(ChildCount," ",17),strfix(class," ",26),strfix(ident," ",7),text))
  53.  
  54.        nextchild=cWndInfo(workwnd,6)
  55.        gosub ProcessGrandchildren    ; note this destroys workwnd variable....
  56.    endwhile
  57. endif
  58. return
  59.  
  60. :ProcessGrandchildren
  61. grandchild=cWndInfo(workwnd,8)
  62. GrandCount=0
  63. if grandchild==0
  64.    FileWrite(myfile,"        X            NONE")
  65. else
  66.    while grandchild
  67.        GrandCount=GrandCount+1
  68.        workwnd=grandchild
  69.        gosub gettextandclass
  70.        FileWrite(myfile,strcat("        ",strfix(GrandCount," ",13),strfix(class," ",26),strfix(ident," ",7),text))
  71.  
  72.        grandchild=cWndInfo(workwnd,6)
  73.        gosub ProcessGreatGrandChildren
  74.    endwhile
  75. endif
  76.  
  77. return
  78.  
  79. :ProcessGreatGrandchildren
  80. greatgrandchild=cWndInfo(workwnd,8)
  81. greatGrandCount=0
  82. if greatgrandchild==0
  83.    FileWrite(myfile,"            X        NONE")
  84. else
  85.    while greatgrandchild
  86.        greatGrandCount=greatGrandCount+1
  87.        workwnd=greatgrandchild
  88.        gosub gettextandclass
  89.        FileWrite(myfile,strcat("            ",strfix(greatGrandCount," ",9),strfix(class," ",26),strfix(ident," ",7),text))
  90.  
  91.        greatgrandchild=cWndInfo(workwnd,6)
  92.        gosub processlevel5
  93.    endwhile
  94. endif
  95.  
  96. return
  97.  
  98. :ProcessLevel5
  99. L5child=cWndInfo(workwnd,8)
  100. L5Count=0
  101. if l5child==0
  102.    FileWrite(myfile,"                X    NONE")
  103. else
  104.    while l5child
  105.        l5count=L5Count+1
  106.        workwnd=l5child
  107.        gosub gettextandclass
  108.        FileWrite(myfile,strcat("                ",strfix(L5Count," ",5),strfix(class," ",26),strfix(ident," ",7),text))
  109.  
  110.        l5child=cWndInfo(workwnd,6)
  111.        gosub processlevel5
  112.    endwhile
  113. endif
  114.  
  115. return
  116.  
  117.  
  118. :GETTEXTANDCLASS
  119. text=cWndInfo(workwnd,0)
  120. ident=cWndInfo(workwnd,1)
  121. class=cWndInfo(workwnd,2)
  122. return     
  123.