Registriert seit: 6. Apr 2011
Ort: Berlin
3.070 Beiträge
Delphi 10.4 Sydney
|
AW: Datumsformat (TT.MM.JJJJ) anzeigen
8. Jun 2018, 14:46
Delphi-Quellcode:
function GetLocaleInfoEx(lpLocaleName: PWideChar; LCType: LCTYPE;
lpLCData: PWideChar; cchData: Integer): Integer; stdcall; external kernel32 name 'GetLocaleInfoEx';
...
var
lpLocaleName: PWideChar; LLCType: LCTYPE;
lpLCData: PWideChar; cchData, ReturnValue: Integer;
DataValue: array of WideChar;
DataString: string;
begin
lpLocaleName := PChar(LOCALE_NAME_USER_DEFAULT);
LLCType := LOCALE_SSHORTDATE;
lpLCData := nil;
cchData := 0;
cchData := GetLocaleInfoEx(lpLocaleName, LLCType, lpLCData, cchData);
if cchData = 0 then
RaiseLastOSError
else
begin
SetLength(DataValue, cchData);
lpLCData := @DataValue[0];
cchData := GetLocaleInfoEx(lpLocaleName, LLCType, lpLCData, cchData);
end;
SetString(DataString, PChar(@DataValue[0]), Length(DataValue));
ShowMessage(DataString);
end;
|
|
Zitat
|