Autor Beitrag
uko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220
Erhaltene Danke: 1

Win XP, VISTA, WIndows 7
Delphi 2007/2010 Prof
BeitragVerfasst: Mo 17.09.07 15:48 
Hallo,

weis jemand, wie man aus den Länderspezifischen Einstellungen das Maßsystem der Zahlen (also Metrisch oder US) auslesen kann? Ich bräucht das um in inch bzw. mm zu rechnen und diese Einheiten dem Benutzer anzuzeigen.

[Delphi 7, ab Windows 2000]

Danke,
Uli
uko Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220
Erhaltene Danke: 1

Win XP, VISTA, WIndows 7
Delphi 2007/2010 Prof
BeitragVerfasst: Mo 17.09.07 16:05 
Antwort gefunden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var
  Buffer : PChar;
  Size : integer;
  strResult: string;
begin
  Size := GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_IMEASURE, nil, 0);
  GetMem(Buffer, Size);
  try
    GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_IMEASURE, Buffer, Size);
    strResult := string(Buffer);
  finally
    FreeMem(Buffer);
  end;
end;


strResult = '0' --> Metrisches System
strResult = '1' --> US-System


grüße,
Uli