K9 - Customizing
How K9 customization works
K9 can be customized to a certain degree through the use of a separate DLL.
A DLL (Dynamic Link Library) is a special Windows file that can contain code, data (resources) or both. In the case of K9 the DLL is called k9.dll and contains only data. Using special tools this data can be changed and will affect the information (text, images etc.) that K9 displays. The primary purpose of using a customized K9 DLL file is to allow for localization i.e. the support of different languages.
When K9 starts, if it sees the k9.dll file in the same directory in which the main k9.exe resides it will attempt to use the resources from the DLL instead of the resources built in to the main program. If you have changed the resources in the DLL you will have effectively customized K9 by making it use your modified resources instead.
Hacking your own custom K9 DLL
First, you need to download a copy of the k9.dll file.
Download k9.dll (25K)
As previously mentioned, in order for K9 to use the resources from the DLL the file k9.dll needs to be placed in the same directory as the main K9 application file k9.exe. This directory is usually located at C:\Program Files\KeirNet\K9.
As it stands this version of k9.dll contains exactly the same resources as found built in to the main K9 program. Therefore, using this file as-is will have no effect on the text or images displayed by K9. If you want to change the text or one of several other items that K9 displays you need to edit the DLL...
Since I do not supply the resource file source code to k9.dll (for several reasons, not least of which is that I'd have to recompile each and every different language version or customized variation that people may send to me) the easiest way to change the data in the DLL is through the use of a resource hacking tool. What these tools do is break apart the raw binary file and extract the various resources contained within them such as text, bitmaps, icons, cursors etc. and allow you to replace or edit them at your will. Once you have made your changes they can be saved back out to the original file.
Perhaps the best resource editing program is called Resource Hacker by Angus Johnson.
Download Resource Hacker (freeware - 541K).
Using Resource Hacker
Although I cannot attempt to teach you how to use Resource Hacker in general, I will show here how to make a simple change to your K9 DLL file to replace some text.
- Step 1. Exit K9.
- Step 2. Start Resource Hacker.
- Step 3. From the File menu select Open and locate the k9.dll file.
- Step 4. Expand the String Table entry and expand the first branch (shown as 14 here) then click the ID value (show here as 1033).
- Step 5. Change the text Recent Emails to something else. In this example I'll change it to Robin's Emails.
- Step 6. When you're done, click the Compile Script button and save the file by selecting File | Save from the menu or simply pressing CTRL-S.
Now that you've saved the new hacked version of k9.dll start up K9 again. Notice that the Recent Emails button now says Robin's Emails!
Things that you can't change
Currently there are some areas of K9 that cannot be customized. These include the text shown on the Statistics page, the Advanced page and the Log page. The reason these aren't yet supported is because I may add or remove new controls to the dialog window and if the entire dialog was present in the k9.dll file you wouldn't be taking advantage of any new features I may have added to the version built-in to K9.