
I think this should work:
You get the window name that you're after, the Process ID of the process that created it and the filename of the executable responsible for that process ...code:
Section "ListWindowsInfo"
FileOpen $8 "c:\tempwindowslist.txt" "w"
SetPluginUnload alwaysoff
System::Get "(i.r1, i) iss"
Pop $R0
System::Call "user32::EnumWindows(k R0, i) i.s"
loop:
Pop $0
StrCmp $0 "callback1" 0 done
System::Call 'user32::GetWindowText(ir1,t.r2,i${NSIS_MAX_STRLEN})i.R6'
System::Call 'user32::GetClassName(ir1,t.r3,i${NSIS_MAX_STRLEN})i.R6'
System::Call 'user32::GetWindowThreadProcessId(ir1,*i.r7)i.r9'
System::Call 'kernel32::OpenProcess(i 0x1F0FFF,i0,ir7)i.R9'
System::Call 'Psapi::GetModuleFileNameExA(iR9,in,t.R8,i${NSIS_MAX_STRLEN})i.R6'
System::Call 'kernel32::CloseHandle(iR9)i.R6'
IntFmt $4 "0x%X" $1
FileWrite $8 "$1 / $4 - [$3] $2$\r$\n"
FileWrite $8 " $1 -->> Thread: $9$\r$\n"
FileWrite $8 " $1 -->> Process: $7$\r$\n"
FileWrite $8 " $1 -->> FileName: $R8$\r$\n"
Push 1 # callback's return value
System::Call "$R0"
Goto loop
done:
SetPluginUnload manual
System::Free $R0
FileClose $8
CF
Leave a comment: