GetLocaleInfo的使用

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

GetLocaleInfo的使用

文章 tim »

參考資料:
http://bbs.toseek.info/cgi-bin/topic.cg ... =81&show=0
http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=34173

代碼: 選擇全部

     
    AnsiString GetLocaleString(LCTYPE lctp) 
    { 
      int j; 
      char *s; 
      j = GetLocaleInfo(GetSystemDefaultLCID(), lctp, 0, 0); 
      s = (char*)malloc(sizeof(char)*j); 
      GetLocaleInfo(GetSystemDefaultLCID(), lctp, s, j); 
      return s; 
    } 
     
     
    void __fastcall Tform1::Button1Click(TObject *Sender) 
    { 
      ShowMessage(GetLocaleString(LOCALE_ILANGUAGE)); 
      ShowMessage(GetLocaleString(LOCALE_SLANGUAGE)); 
      ShowMessage(GetLocaleString(LOCALE_SENGLANGUAGE)); 
      ShowMessage(GetLocaleString(LOCALE_SABBREVLANGNAME)); 
      ShowMessage(GetLocaleString(LOCALE_SNATIVELANGNAME)); 
    } 
多多留言, 整理文章, 把經驗累積下來.....
回覆文章