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));
}