Archive: Help needed to call main program at foreground


Help needed to call main program at foreground
Hi all:

I have what I hope is a very basic question, but I haven't been able to solve it by myself so I ask for your kind help.

I have created a NSIS installer using the Assistant, but the problem I have is that the call to the main aplication (TIMETUNNEL.EXE) makes it always being executed at background. (I cannot see it if there are other Windows opened unless I begin to close windows.)

As I understand it's always predefined in the MACRO MUI_FINISHPAGE_RUN "$INSTDIR\TIMETUNNEL.exe",

so, how could I tell the installer to execute it at foreground as the Active Window?

Thanks anticipated.


http://forums.winamp.com/showthread.php?threadid=268418


Thank you very much. I will try that


Just a note. That will put your installer into an infinite loop if the user chooses not to run your app. Using a For loop would be more desirable:


${For} $R0 1 10
FindWindow $R1 `` `my app title`
${If} ${Cmd} `IsWindow $R1`
System::Call `user32::SetForegroundWindow(i R0)`
${Break}
${EndIf}
Sleep 1000
${Next}


Stu

Thanks a lot. I'm trying your code, AfroUK. Actually the other one gave some errors while compiling.

I will write in 10 minutes to tell the result.

Regards


It worked fine!!. Thanks a lot to all for your help.