Jump to page content

Obsolete technical tips

The following questions and answers are for historical reference only; some may still be relevant, and others will not.

Questions

Answers

Creating working File > New entries

There is already plenty of content on the Web describing how to add File > New entries to Windows Explorer, including references to using Microsoft’s free power toy TweakUI. Some of us are quite content to just do it using the Registry (especially as that gives you much better control than TweakUI as to what sort of new file you get). However, very frustratingly, sometimes it does not work. No matter what you try, and how perfect your new Registry entries are, you do not get a new entry under New.

There are at least two reasons for this. First and foremost, the file type must have an “Open” action. Some software uses a different name for the default action, such as “Open in some program”, “Play” or what not. Windows is happy to use such an action as the default for when you double-click a file, but in order to see an entry in the New menu, there must be an Open action for the file type. The correct way to give the Open action a custom name is to use the default value for the key. e.g.

[HKEY_CLASSES_ROOT\FirefoxHTML\shell\open]
@="&Open in Firefox"

The visible name will be set to the default value but Windows will still consider it to be the Open action. TweakUI will raise an error if you attempt to generate a New entry for a file type with no Open action, considering it to be unassociated. (For the curious: under Windows 2000 at least, using Folder Options to re-associate the Open action will remove any custom action name chosen, so you won’t be left with stray names.)

Secondly, the file type must have a name. It is possible with TweakUI under Windows 2000 to generate a New entry for an unnamed file type, but doing it by hand under Windows XP fails: no menu item shows up. The reason for needing a file type name is that this is what Windows uses for the New menu item and the filename for the newly-created file. If you omit the name under Windows 2000, you get a makeshift name like “JPEGFILE”.

My learning ground for this issue was Firefox. Earlier versions did indeed name the Open action something else, and after reporting this and having it fixed, they nevertheless failed to name the file type and so I still was not able to get it to work when I tried it on another machine. Developers, take note!

Aborting an endless stream of JavaScript dialogs

Every now and then, some delightful soul is going to send you to one of those prank Web pages that pop up endless JavaScript dialog boxes bearing stupid or taunting messages. The offending dialog boxes lock out the window or, on a Macintosh, the entire program, leaving you with possibly no option but to kill the program dead, along with all your open pages. If you have session saving enabled, the page will come back on reload leaving you in worse trouble! But here are some tips:

iCab for Macintosh: Press Cmd-Shift-J and then close the current alert dialog. This signals iCab to terminate the offending JavaScript once the dialog closes. iCab may well be the only browser to offer this feature, and I stronly suggest that other browsers get in on the act.

Firefox: Close the current alert dialog and immediately press ctrl-W (on a PC) or cmd-W (on a Macintosh) to close the offending tab. This seems to be the only way of getting a response from the interface; attempting to use the mouse to close the tab failed for me. One more dialog will likely appear but with the tab gone, it will be the last one you see.

For other browsers, I can only suggest you try using either keyboard or mouse instructions to close the tab or window immediately after closing one of the alert dialogs and before the next one opens.

How can I have gapless music playback in Winamp?

I have seen a few solutions to gapless playback in Winamp, including a plugin by “Crudsoft” that uses the lesser WaveOut output plugin, but Winamp itself has perfect support for gapless playback using the DirectSound plugin. You just have to realise how.

Set Winamp to use the (already superior) DirectSound output plugin, and then set these DirectSound options:

The mistake I made was to assume that the first setting is all you need, but it doesn’t quite work for MP3: it still introduces a slight amount of silence between tracks that is enough to be irritating. The reason being – I read recently – is that due to the lossy compression in the audio, there is a small amount of silence and then a small amount of error at the beginning of the file, and then the reverse at the end. There is a small amount of cross-fade performed against every pair of frames within a file to counteract compression artefacts, but not against the end of one file and the start of another. The silence removal cuts out this tiny amount of leading and trailing silence and leaves you with pretty reliable gapless playback.

Avoiding fuzzy gaim buddy icons

The gaim (now Pidgin) multi-protocol IM client had a nasty habit – long since resolved – of blurring your own buddy icons when you select them, in the Windows version at least. It was suggested by gaim developer Stu Tomlinson in response to gaim bug 1092532 (fuzzy MSN display icons) that it was something to do with converting images to PNG format as required by MSN. I found this guess to be correct, and the bug was unfortunately closed without resolution (as though image format conversion is supposed to leave images all blurred). The problem actually affected all gaim protocols supporting buddy icons; each protocol only accepts certain formats and using anything else caused gaim to blur the image during conversion.

The acceptable formats are:

Converting buddy icons to these formats first will ensure that they do not become blurred. Note that this bug has long since been solved.

Making Thunderbird’s Outbox work like a real mail client

Most graphical mail clients, on sending a message, drop the message into the Outbox, close the compose window, and then send the message silently in the background. Even at version 3.0, Thunderbird still hasn’t got this figured out. Fortunately, there is a horrible hack of a workaround that gives Thunderbird a classical Outbox behaviour the same as any other graphical mailer. (Note, this behaviour is now integrated into Thunderbird as a hidden setting.)

  1. Install the BlunderDelay, MagicSLR, and keyconfig add-ons, and restart Thunderbird. While not all of these add-ons are compatible with Thunderbird 3.0 at the time of writing, I have had no issues using this solution with the 3.0 beta series and 3.0 final. You can use the Nightly Tester Tools add-on to force the add-ons to install under 3.0.
  2. Removing the Send button from the toolbar of the message composition window, and replace it with the new Send Later button provided by MagicSLR (this is the only thing we will be using it for).
  3. Leaving the composition window open, return to the main Thunderbird window, and select ToolsKeyconfig. Select the compose window from the menu of open windows; you may need to put something into the subject line of the compose window for Keyconfig to pick up a title for that window at all.
  4. In the Keyconfig window, scroll down to Send and Send Later. Select each one, focus the text box at the bottom containing the current shortcut, and type the keyboard shortcut of the other item, swapping the shortcuts. Ignore the warning about mapping the same shortcut twice. For example, set Send to Send to ctrl+shift+enter and Send Later to ctrl+enter.
  5. Open up the BlunderDelay options, making sure that BlunderDelay is enabled, and that the delay time is set to something short, like two seconds.

Now, when you use the toolbar or keyboard to send a message, the message is placed into the Outbox for sending later, and the compose window instantly closes: you’ve swapped out the toolbar button and swapped the keyboard shortcuts. BlunderDelay will then swoop up the message and send it in the background. There is a way to have the compose window simply minimise on send and then disappear when done, but I did not find that satisfactory and wanted Thunderbird to behave properly.

The only cost is that you do lose the ability to defer sending messages. However, this is not likely to be a great issue to anyone.

Regaining ownership of .html files in Office 2003

When you install Microsoft Office 2003, it has an obsessive need to take over as your HTML icon handler and editing handler. I don’t imagine that earlier or later versions are much if any different but version 2003 is the one I use in the office. You will find your HTML file association to look something like the following:

[HKEY_CLASSES_ROOT\FirefoxHTML\DefaultIcon]
@="\"%1\""

[HKEY_CLASSES_ROOT\FirefoxHTML\shell\Edit\command]
@="\"C:\\Program Files\\Microsoft Office\\OFFICE11\\msohtmed.exe\" %1"

The first step to remove this is supposedly (in Word 2003) Tools → Options → General → Web Options, but I don’t see now the option that used to be there. However, the Registry will sometimes restore itself. To put everything back as it was, enter the following commands (where OFFICE11 is Office 2003):

cd "%programfiles%\Microsoft Office\OFFICE11"
regsvr32 /u MSOHEV.DLL

This will restore your previous Registry settings. There is a similar one to remove to stop Office interfering with your XML files, but I forget which.

Removing the synchronised badge on icons

When a copy of a file is being synchronised and held in Offline Files, Windows Explorer sees fit to put an annoying badge onto the icon, that covers over the shortcut badge of any shortcuts. The only purpose these icons appear to have is to thoroughly clog up your desktop, preventing you from seeing icons correctly or determine which files are shortcuts (especially if you’ve set Explorer to not add the worthless “Shortcut to” to shortcut names. How do you remove these useless badges, correctly known as “shell icon overlays”? Simple: remove the following Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\Offline Files. There, all gone.

Shell icon overlays are well understood, but this was one of those things that took me an age to track down due to not knowing that Microsoft calls their icon badges “overlays”. Likewise, finding out anything about the size grip in the corner of a window in Windows is very difficult if you only know of it by another name, such as the Macintosh term of “grow box”.

Using Perl scripts as droplets

Wouldn’t it be nice if you could use Perl scripts in Windows as “droplets”? You can drop files onto VBScript and JScript files to pass them to the script as arguments; why does this not work with Perl scripts? You need to copy the dragon-droppings handler used by Microsoft’s languages, and add it to Perl scripts, like so:

[HKEY_CLASSES_ROOT\Perl.Win32\shellex\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"

Here, I’ve used a special file extension and type (.wpl and Perl.Win32 respectively) to provide a dedicated icon and behaviour for scripts intended to be used in a graphical environment, that run through ActiveState’s wperl.exe, so that a console window doesn’t flash up needlessly, especially if I’m using wxWidgets for my interface.