与起对应的函数为
int GetLocaleInfo(
LCID Locale, // locale identifier
LCTYPE LCType, // type of information
LPTSTR lpLCData, // address of buffer for information
int cchData // size of buffer
);
主要用于取得当前系统的区域设置,各个参数和使用过程不再一一说明。
3 使用举例
//取得当前系统的短日期格式;
function Tfrmmain.GetsysDateFormat: string;
var
sgs:string;
begin
setlength(sgs,12);
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE ,PChar(sgs),12);
result:=string(pchar(sgs));
end;
//设定系日期格式;
procedure Tfrmmain.SetSysDateFormat(s: string);
begin
SetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE,PChar(s));
end;









