1!define LVM_GETITEMCOUNT 0x1004
2!define LVM_GETITEMTEXT 0x102D
3
4Function DumpLog
5  Exch $5
6  Push $0
7  Push $1
8  Push $2
9  Push $3
10  Push $4
11  Push $6
12
13  FindWindow $0 "#32770" "" $HWNDPARENT
14  GetDlgItem $0 $0 1016
15  StrCmp $0 0 error
16  FileOpen $5 $5 "w"
17  StrCmp $5 0 error
18    SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
19    System::Alloc ${NSIS_MAX_STRLEN}
20    Pop $3
21    StrCpy $2 0
22    System::Call "*(i, i, i, i, i, i, i, i, i) i \
23      (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
24    loop: StrCmp $2 $6 done
25      System::Call "User32::SendMessageA(i, i, i, i) i \
26        ($0, ${LVM_GETITEMTEXT}, $2, r1)"
27      System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
28      FileWrite $5 "$4$\r$\n"
29      IntOp $2 $2 + 1
30      Goto loop
31    done:
32      FileClose $5
33      System::Free $1
34      System::Free $3
35      Goto exit
36  error:
37    MessageBox MB_OK error
38  exit:
39    Pop $6
40    Pop $4
41    Pop $3
42    Pop $2
43    Pop $1
44    Pop $0
45    Exch $5
46FunctionEnd
47