Geoff Chappell - Software Analyst
A well-established way to organise multi-language software is to separate the code from the localised resources. Each executable is the same for all languages but is accompanied by a different resources library, sometimes called a satellite DLL, for each supported language.
Windows itself is organised this way in Windows Vista. The satellites have “.mui” appended to the name of their executable and are placed in language-specific subdirectories of wherever their executable is run from. Knowledge of this scheme of satellites is built into the system code that loads resources, so that multi-language support comes essentially for free at run-time. The executable is written exactly as if the resources were in the executable intead of having been separated into an MUI file.
Moreover, the Windows Vista MUI scheme is available even when running on earlier Windows versions. The run-time price is that the programs must be specially written to know to load the satellite and to provide a handle to the satellite (instead of to the executable) when asking for resources. Microsoft greatly eases this work by providing functions in a statically-linked library (MUILoad.lib). The most notable are LoadMUILibrary and FreeMUILibrary, to use instead of the standard API functions LoadLibrary and FreeLibrary.
Unsurprisingly, this is not Microsoft’s first draft. An early MUI scheme is seen in Internet Explorer 5.0, from as long ago as 1999. A generalisation of Internet Explorer’s MUI scheme is explicitly supported by the LoadMUILibrary function just mentioned. The reason it’s being talked of here, in a collection of articles about functions exported from SHLWAPI.DLL, is that where the Windows Vista scheme has a statically-linked library with its LoadMUILibrary and FreeMUILibrary, the Internet Explorer scheme has the dynamically-linked SHLWAPI with its exported functions MLLoadLibrary and MLFreeLibrary.
In Internet Explorer’s MUI scheme, a default satellite is in the same directory as its executable, but the multi-language satellites are in directories iepath\mui\langid, where iepath is the installation directory for Internet Explorer and langid is a four-digit hexadecimal code for the language that the particular satellite supports.
To keep talking of this as the Internet Explorer scheme is perhaps not entirley fair. Microsoft may have intended all along that the scheme should apply more generally. For many years, as seen in the MSDN Library on CD in editions dated January 2001 and January 2004, Microsoft’s documentation of MSLoadLibrary allowed for the satellites to be placed beneath the installation directory of any component, not just of Internet Explorer. How much one can make of this as a general intention is unclear, however. The documentation somehow managed not to describe the mui\langid subdirectories that are vital to putting the scheme to any actual use and the function as described in the documentation didn’t even have the right number of arguments. In all retail releases of SHLWAPI, the MSLoadLibrary function necessarily has the satellites in the directory tree beneath the Internet Explorer installation, as did eventually get described, e.g., in the Windows Vista Software Development Kit dated January 2007.