Delphi Tip 로케일(Locale) 확인 하기

Programming/Delphi 2010.01.20 10:48 Posted by 파란크리스마스

원본 사이트 : http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_10231553.html

procedure TForm1.Button1Click(Sender: TObject);

  function GetLocale(ALcid: Integer): string;
  var s: string;
  begin
    Result := '[Unknown]';
    SetLength(s, 128);
    if GetLocaleInfo(ALcid, LOCALE_SENGLANGUAGE, PChar(s), 128) > 0 then
      begin
        Result := StrPas(PChar(s));
        if GetLocaleInfo(ALcid, LOCALE_SENGCOUNTRY, PChar(s), 128) > 0 then
          begin
            Result := Format('%s (%s)', [Result, StrPas(PChar(s))]);
          end;
      end;
  end;

begin
  showmessage(GetLocale(GetUserDefaultLangID));
end;

더보기


 

신고


 

티스토리 툴바