>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/