Archive: NSIS messages load behind other windows


NSIS messages load behind other windows
Whenever I run the installer I've created with my NSIS script, the initial window that come up always loads behind my current open window.

I've found reference to the problem here: http://forums.winamp.com/showthread....=&pagenumber=1 near the bottom of the page from Takhir in the iNetLoad plugin thread. I AM in fact using iNetLoad in silent mode, so I assume that is what is causing it. Apparently it was introduced in NSIS version 2.03 and we're now on version 2.19 :(

Has anyone found a workaround for this, or has it not been addressed at all?


InetLoad itself not manages NSIS dialogs appearance. If you want move dialog to foreground when download finishes, good way is to use SetForegroundWindow (use forum search for samples). But InetLoad had this option long ago, and code still presents (as commnet) :) So attached build with 'setforeground' enabled may help as well.


How do I use this different version? It seems to be putting extra things on the stack or someting and messing up other checks I'm doing.

I've also tried creating this function and using it for .onGUInit

Function guiInit
FindWindow $0 "" "myApp Setup"
System::Call "user32::SetForegroundWindow(i 0) i.."
FunctionEnd

But it seems to have no effect. I can't find any documentation on how to actually use SetForegroundWindow neither here nor in the wiki.


Section "Dummy Section" SecDummy
DetailPrint "Waiting 3 sec - set another window foreground"
Sleep 3000
StrCpy $0 $HWNDPARENT
System::Call 'user32::SetForegroundWindow(i r0)'
DetailPrint "Waiting 2 sec - is Installer FG?"
Sleep 2000
DetailPrint Finished
SectionEnd
this worked in my test.
ShowWindow $HWNDPARENT ${SW_RESTORE}
Also helps sometimes in guiInit