GetLocaleInfo的使用

有關Delphi 的語法, 程式, 等
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

GetLocaleInfo的使用

文章 tim »

參考資料:
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; 
多多留言, 整理文章, 把經驗累積下來.....
回覆文章