Closed Bug 231514 Opened 21 years ago Closed 21 years ago

ShellExecute does not always bring the correct browser window into focus

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 158691

People

(Reporter: dboyd, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

I am using ShellExecute to open a browser window:
ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
When ShellExecute is invoked, it either changes the current browser to the web
page assigned to the variable 'url', or brings up a new browser and goes to the
url. This is fine and works as it should. If i have a mozilla window up and i
have gone to mail through the mozilla task bar, it of course creates a new
window for the mail. If my mail window is in focus and I invoke ShellExecute, it
changes the other mozilla window as it should, but it does not bring it into
focus. The mail window stays in focus. 
What it looks like it does is cycles through the browser instances that are open
and opens the URL in one of them, if the next browser in the list is the mail
window, it brings the mail window into focus, and opens the URL in the next
browser in the list, but keeps it minimized.
So the problem is the correct browser not gaining focus when called through
ShellExecute, when the mail window open.

Reproducible: Always

Steps to Reproduce:
1. Write a small test program to use ShellExecute and call any web site.
2. Open a Browser window
3. Open netscape mail from the browser task bar
4. Minimize the browser windows
5. Run the program to call ShellExecute
6. The mail browser gains focus, but the URL is opened in the other browser.
7. Run the program to call ShellExecute again
8. The correct browser(not the mail browser) will gain focus
Actual Results:  
Mail browser gains focus, but the other browsers URL changes.

Expected Results:  
Running ShellExecute should bring the correct browser into focus everytime, the
browser who's URL is changing.

*** This bug has been marked as a duplicate of 158691 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.