Archive: ExecShell with focus


ExecShell with focus
How to execute newly installed (by NSIS) program, with keyboard focus?

Now I am doing this with:
ExecShell "" '"$INSTDIR\myprogram.exe"'

But sometimes focus is on program who executed NSIS installer (i.e. total commander, or Explorer).


Use this:

FindWindow $1 "" "MyApp Title" 0 0
System::call "user32::SetWindowPos(i r1, i -1, i 0, i 0, i 0, i 0, i 0x02|0x01) i.r1"
Pop $1


-Stu