unit loc_unit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1 : TForm1;
LocalesList : TStringList;
implementation
{$R *.DFM}
function SystemLocales(Locale : PChar) : Bool; stdcall; export;
Var
Data : Array[0..63] of Char;
Full : Array[0..63] of Char;
begin
GetLocaleInfo(StrToInt('$'+Locale), LOCALE_SENGLANGUAGE, @Full, 64);
GetLocaleInfo(StrToInt('$'+Locale), LOCALE_SENGCOUNTRY, @Data, 64);
LocalesList.Add(StrPas(Locale)+' '+StrPas(Full)+' ('+StrPas(Data)+')');
Result := True; {True to continue}
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumSystemLocales(@SystemLocales, LCID_INSTALLED);
ListBox1.Items := LocalesList;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
LocalesList := TStringList.Create;
end;
end.
|