Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:26:32+00:00 2026-05-22T18:26:32+00:00

I have this nsis script, … nsExec::Exec openFirstWindow.exe ;HERE This exe will open a

  • 0

I have this nsis script,

…

nsExec::Exec "openFirstWindow.exe"  ;HERE This exe will open a FIRST WINDOW to whatever url

Pop $exe_return_code
StrCmp $exe_return_code "0" exe_success
Goto exe_done
exe_success:
    ;HERE is the call to the SECOND WINDOW
    UAC::Exec '' '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "http://www.google.ca"' '' ''

exe_done:

…

The problem is that randomly, I get the FIRST window in foreground and the SECOND behind,
and sometimes I get the SECOND window in front of the FIRST.

My guess is that it is due to the FIRST window taking random time to open and
if the SECOND window finishes opening before the FIRST one, then the FIRST one will get the focus and be on top.

Does anyone have a solution to make sure that the SECOND window has focus ?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:26:33+00:00Added an answer on May 22, 2026 at 6:26 pm

    Use this simple loop to bring required window in the front. (I used Exec, but works fine with UAC and nsExec)

    ; This Window is opened as first
    Exec '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "www.google.sk"' 
    ; This is opened later
    Exec '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "www.unsigned-softworks.sk/installer"'  
    
    CheckWindow:
      Sleep 500 ; Wait some time (miliseconds)
    
      ; Find by Window class and by Window name 
      FindWindow $1 "IEFrame" "Google - Windows Internet Explorer" 
    
      ; If window is not found (not loaded!) search again 
      IntCmp $1 0 CheckWindow Continue Continue
    
    Continue:
      # If found (opened & loaded), bring it to front
      System::Call "User32::SetForegroundWindow(i) b ($1)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The
I have this line in a useful Bash script that I haven't managed to
I have a NSIS script with a number of sections and a section group.
I'm working on an NSIS script in which I have two directory pages. One
In my NSIS script, I use this line: File ..\help\*.* My problem is that
I have an NSIS installer script that I'm using to deploy a py2exe-built app
I have a Java application and a NSIS script . I need to run
I have a NSIS script that is working well for a large application. I
I have an Eclipse RCP application where I use NSIS to generate the exe
Often my exe's have dll dependencies that I package with an installer like nsis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.