Tux2000: Default text-editor for IE

Beitrag lesen

Hi Alex,

the trick you mention about replacing the original notepad.exe is fine, in general, but...
Windows itself does quite the same masquerade to pretend the presence of write.exe for the sake of backward compatibility to Windows 3.x. This write.exe, however, is just a stub that invokes wordpad.exe and passes the entire command line along.
Quite some time ago, I thought I could use this stub, rename it, patch the filename "wordpad.exe" and use that as a notepad.exe replacement. It works for almost any application that would normally invoke Notepad, except for IE when I try to view the source code. The reason is that IE obviously does not enclose the file name in quotes when invoking Notepad. So my editor complains "Can't find 'Temporary'", "Can't find 'internet'", "Can't find 'files'", etc.
Do you happen to know a workaround for this?

Hope you do,

Martin

I know that bug from the Ultraedit Notepad.EXE replacement. A solution would be compiling an own Notepad replacement that counts its arguments. If there is one argument, take it as filename. If there is more than one argument, join the arguments with spaces and take the result as filename. Then, invoke the "real" editor with the filename properly quoted. If there is no argument, do something reasonably, like popping up a configuration dialog or simply invoking the "real" editor without a filename argument.

Nice extra: An INI file where you can select the "real" editor and maybe enable converting long to short filenames.

Basically not more than one page C-Source.

Tux2000