Archive: Usage of EnumWindows


Usage of EnumWindows
I tried to use the following script to enumerate application window titles,but it did not get anticipated result.How to correct the script?
********************************************************
SetPluginUnload alwaysoff

System::Get "(i.r1, i) iss"
Pop $R0
StrCpy $r9 ${NSIS_MAX_STRLEN})
System::Call "user32::EnumWindows(k R0, i) i.s"
System::Call "user32::GetWindowText(i r1,t.r2,i $r9)"
MessageBox MB_OK $1

SetPluginUnload manual
System::Free $R0
***********************************************************
Thanks very much to help me!!!!!!!!!
John


What's the anticipated result and what did you get?


I got a "Ctr+F9.." text once in a while.

If I only opened internet explorer.exe and is visiting this forum,I want to get the title " WINAMP.COM | Forums -...".If I execute another A.exe,I want to eumerate the titlef A window.How to write the script.I don't know the class names of the window.


The documentation has an example for callback functions using EnumChildWindows. It shouldn't be too hard to adapt to EnumWindows. All you need to do is pass one less parameter when switching to EnumWindows.