怎样在程序中读取系统中设置的国家?
解决方案 »
- 该死的 unable to find record. No key specified 高手指点下
- 字符串判等
- 我朋友用VC写,我用delphi,现在VC把一张bmp的图放在内存传入(我写dll),请问delphi如何读取内存中的bmp图,并放在Timage中?
- 如何用程序在Access数据库连接里用sql访问外部带密码的access数据库?
- 数据库多表嵌套操作,100分相送.
- 非常简单的问题,来那分吧!(Combox的问题)
- 这个ROUND到底是做什么的?
- 在使用Table要用户名与密码?
- 为什么我写的COM在服务程序中创建出问题?
- fastreport打印预览问题
- 关于双字节支持的问题,内有详细说明
- 一个小得问题啊!定义时的问题啊?请各位老大鼎力帮助我啊!谢谢啊!
var FormatSettings: TFormatSettings);
var
HourFormat, TimePrefix, TimePostfix: string;
DefaultLCID: Integer;
begin
if IsValidLocale(LCID, LCID_INSTALLED) then
DefaultLCID := LCID
else
DefaultLCID := GetThreadLocale; GetLocaleMonthDayNames(LCID, FormatSettings);
with FormatSettings do
begin
CurrencyString := GetLocaleStr(DefaultLCID, LOCALE_SCURRENCY, '');
CurrencyFormat := StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_ICURRENCY, '0'), 0);
NegCurrFormat := StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_INEGCURR, '0'), 0);
ThousandSeparator := GetLocaleChar(DefaultLCID, LOCALE_STHOUSAND, ',');
DecimalSeparator := GetLocaleChar(DefaultLCID, LOCALE_SDECIMAL, '.');
CurrencyDecimals := StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_ICURRDIGITS, '0'), 0);
DateSeparator := GetLocaleChar(DefaultLCID, LOCALE_SDATE, '/');
ShortDateFormat := TranslateDateFormat(GetLocaleStr(DefaultLCID, LOCALE_SSHORTDATE, 'm/d/yy'));
LongDateFormat := TranslateDateFormat(GetLocaleStr(DefaultLCID, LOCALE_SLONGDATE, 'mmmm d, yyyy'));
TimeSeparator := GetLocaleChar(DefaultLCID, LOCALE_STIME, ':');
TimeAMString := GetLocaleStr(DefaultLCID, LOCALE_S1159, 'am');
TimePMString := GetLocaleStr(DefaultLCID, LOCALE_S2359, 'pm');
TimePrefix := '';
TimePostfix := '';
if StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_ITLZERO, '0'), 0) = 0 then
HourFormat := 'h' else
HourFormat := 'hh';
if StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_ITIME, '0'), 0) = 0 then
if StrToIntDef(GetLocaleStr(DefaultLCID, LOCALE_ITIMEMARKPOSN, '0'), 0) = 0 then
TimePostfix := ' AMPM'
else
TimePrefix := 'AMPM ';
ShortTimeFormat := TimePrefix + HourFormat + ':mm' + TimePostfix;
LongTimeFormat := TimePrefix + HourFormat + ':mm:ss' + TimePostfix;
ListSeparator := GetLocaleChar(DefaultLCID, LOCALE_SLIST, ',');
end;
end;
LOCALE_ICOUNTRY = $00000005; { country code }
{$EXTERNALSYM LOCALE_SCOUNTRY}
LOCALE_SCOUNTRY = $00000006; { localized name of country }
{$EXTERNALSYM LOCALE_SENGCOUNTRY}
LOCALE_SENGCOUNTRY = $00001002; { English name of country }
{$EXTERNALSYM LOCALE_SABBREVCTRYNAME}
LOCALE_SABBREVCTRYNAME = $00000007; { abbreviated country name }
{$EXTERNALSYM LOCALE_SNATIVECTRYNAME}
LOCALE_SNATIVECTRYNAME = $00000008; { native name of country }