Posted by
Jeremy Winston-2 on
Feb 16, 2007; 8:41pm
URL: http://imagej.273.s1.nabble.com/Bug-openURL-on-MS-Windows-with-default-browser-IE-tp3699891p3699895.html
Jeremy Winston wrote:
> Curtis Rueden wrote:
>> On Windows XP with IE7, I could not duplicate the problem. It also
>> works fine with Firefox. In addition, Microsoft's solution requires
>> Microsoft-specific classes (com.ms.*) available only to Visual J++
>> (not Sun's JVM). So Microsoft's official solution is proprietary (big
>> surprise). So I would suggest ImageJ stick with the rundll32 solution.
>
> Thus far, it seems that Windows 2000 with IE 5 or 6
> is the only combination affected. NT4 with IE 6
> is not affected, and XP with IE7 is not affected.
> I have been unable to determine whether it is IE6
> or W2K that is the culprit. I.e., I don't know
> if RUNDLL32.EXE (part of the OS) or URL.DLL (part
> of IE) is at fault.
>
> It seems to me that a workable kludge would be to
> check if the OS is Windows 2000, and if so, if the
> URL to be opened ends in .htm or .html, then change
> the 'm' to %6D or the 'l' to %6C.
After some more digging, here's a better fix (courtesy
of
http://mmb.mediachance.com/mmbhelp/FAQdll.htm ), still
using rundll32, but using shell32.dll instead of url.dll:
rundll32 shell32.dll,ShellExec_RunDLL
http://rsb.info.nih.gov/ij/notes.htmlAssuming that only Windows 2000 (running either IE5 or
IE6) is affected, this would translate into Java-esque
pseudocode inserted in place of line 415 of
BrowserLauncher.java
http://rsb.info.nih.gov/ij/docs/source/ij/plugin/BrowserLauncher.java.html#414 if (System.getProperty("os.name").startsWith("Windows 2000"))
String cmd = "rundll32 shell32.dll,ShellExec_RunDLL " + url;
else
String cmd = "rundll32 url.dll,FileProtocolHandler " + url;
The shell32.dll approach may work with all versions of
Windows after and including Windows 2000. (It doesn't
work with Windows NT4, as its shell32.dll does not have
the ShellExec_RunDLL function.)
Of course, I have yet to get any feedback from anyone else
suffering from this problem, so for all I know, there is
something misconfigured with my IE6 or W2K, and no one else
sees this problem.
Feedback appreciated,
-Jeremy