在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
function GetWindowsLanguage: string; var WinLanguage: array [0..50] of char; begin VerLanguageName(GetSystemDefaultLangID, WinLanguage, 50); Result := StrPas(WinLanguage); end; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(GetWindowsLanguage); end; {********************************************************************} { another code: {********************************************************************} function GetWindowsLanguage1(LCTYPE: LCTYPE {type of information}): string; var Buffer : PChar; Size : integer; begin Size := GetLocaleInfo (LOCALE_USER_DEFAULT, LCType, nil, 0); GetMem(Buffer, Size); try GetLocaleInfo (LOCALE_USER_DEFAULT, LCTYPE, Buffer, Size); Result := string(Buffer); finally FreeMem(Buffer); end; end; procedure TForm1.Button2Click(Sender: TObject); begin Caption := GetWindowsLanguage1(LOCALE_SABBREVLANGNAME); (* LOCALE_ILANGUAGE { language id } LOCALE_SLANGUAGE { localized name of language } LOCALE_SENGLANGUAGE { English name of language } LOCALE_SABBREVLANGNAME { abbreviated language name } LOCALE_SNATIVELANGNAME { native name of language } *) end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论