I'm using the Win API function EnumUILanguages on a Windows XP Embedded build that has Chinese and French shell language packs (MUI) installed, however the API call only returns one language code: 0409 (the base en-US installed language).
If I look in the registry under HKLM\SYSTEM\CurrentControlSet\Control\Nls\MUILanguages\ then I can see all of the available languages (0409, 040C, 0804). I'd prefer to use the API call over accessing the registry directly.... any suggestions as to why this API call returns just the only language?
Thanks, Duncan
Update: A little code and information - I'm calling this from a form with a memo box and a button. Press the button, the WinAPI call is initiated and a pointer to the Strings property of the TMemoBox passed so the call back function can write to it.
// The Button handler
procedure TForm1.btnEnumLangsClick(Sender: TObject);
var
dwFlags : DWORD;
callback : TEnumUILanguagesProc;
begin
dwFlags := 0; // Same as MUI_LANGUAGE_ID for WinXP compat
EnumUILanguagesW( @EnumUILanguages_Callback,
dwFlags,
LParam(memoUILangs.Lines) // Pointer to Memo box text lines
);
end;
// API Callback function:
function EnumUILanguages_Callback(lpUILanguageString: PWideChar;
List: TStringList): BOOL; stdcall;
begin
// Add language ID to the memo box
List.Add(lpUILanguageString);
// Return true so the callback continues to run
Result := True;
end;