I guess there's just no way to do it so that all browsers behave the same. And you would not want to have code for all the major browsers out there - talk about maintainability.
How about making your code smart enough to deal with it? Open a new browser, deliberately empty, i.e. w/o passing a url. Walk thru the list of top level windows and note all of them. Run the ShellExecute to have the browser open the url and then check the window list again to see if an additional browser showed up. If so, kill the first one. See Alone.pl at www.fairymails.com/perl/ for code on these lists of windows. Of course, when you just open a browser with no url, they will likely try to show the default start page and you might want to avoid that. Or the second browser will not display with the window settings (size and position) that you like. Or what if the target url opens a second browser window with a dumb ad in it, then you kill the target window and keep the ad ... Well ... for every solution, there's three new problems, rite? Have fun, Harald > -----Original Message----- > From: Morbus Iff [mailto:[EMAIL PROTECTED] > Sent: Friday, June 15, 2001 08:40 > To: perl-win32-gui-users@lists.sourceforge.net > Subject: RE: [perl-win32-gui-users] Opening a *New* Browser Window? > > > >use Win32::TieRegistry; > >use Win32::API; > > > > $url = "http://www.activestate.com"; > > my $http = > $Registry->{"Classes\\http\\shell\\open\\command"}->{'\\'}; > > unless ( $pid = fork ) { system("$http $url"); } > > > > if (! $pid){ > > my $ShellExecute = new Win32::API("shell32", > > "ShellExecuteA",['N','P', 'P', > > 'P', 'P', 'I'], 'N'); > > $ShellExecute->Call(0, "open", $url, 0, 0, 1); > > } > > > > I just barely got around to trying this code today. Again, > what I'm trying > to attempt is a cross browser way of opening a NEW window if > an existing > browser window is already open. > > The code above works fine for IE 6. However, Mozilla doesn't > understand the > passed $url to the system command above. Thus, I get one window with > Mozilla saying it couldn't find %1, and then another window > with the actual > URL correctly thrown in. > > Sigh. Ah twell. > > > Morbus Iff > .sig on other machine. > http://www.disobey.com/ > http://www.gamegrene.com/ > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >