http://forum.nifty.com/fdelphi/samples/00390.html
代碼: 選擇全部
function GetLocaleString(lctp: LCTYPE): String;
var
j: Integer;
s: String;
begin
j := GetLocaleInfo(GetSystemDefaultLCID, lctp, PChar(nil), 0);
SetLength(s, j);
GetLocaleInfo(GetSystemDefaultLCID, lctp, PChar(s), j);
SetLength(s, j-1);
Result := s;
end;
procedure Tform1.Button1Click(Sender: TObject);
begin
showmessage(GetLocaleString(LOCALE_ILANGUAGE));
showmessage(GetLocaleString(LOCALE_SLANGUAGE));
showmessage(GetLocaleString(LOCALE_SENGLANGUAGE));
showmessage(GetLocaleString(LOCALE_SABBREVLANGNAME));
showmessage(GetLocaleString(LOCALE_SNATIVELANGNAME));
end;