MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / GetLanguage

Method GetLanguage

Source/script.cpp:10495–10514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10493}
10494
10495VarSizeType Script::GetLanguage(char *aBuf)
10496// Registry locations from J-Paul Mesnage.
10497{
10498 char buf[MAX_PATH];
10499 if (g_os.IsWinNT()) // NT/2k/XP+
10500 {
10501 if (g_os.IsWin2000orLater())
10502 RegReadString(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Nls\\Language", "InstallLanguage", buf, MAX_PATH);
10503 else // NT4
10504 RegReadString(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Nls\\Language", "Default", buf, MAX_PATH);
10505 }
10506 else // Win9x
10507 {
10508 RegReadString(HKEY_USERS, ".DEFAULT\\Control Panel\\Desktop\\ResourceLocale", "", buf, MAX_PATH);
10509 memmove(buf, buf + 4, strlen(buf + 4) + 1); // +1 to include the zero terminator.
10510 }
10511 if (aBuf)
10512 strcpy(aBuf, buf);
10513 return (VarSizeType)strlen(buf);
10514}
10515
10516VarSizeType Script::GetUserOrComputer(bool aGetUser, char *aBuf)
10517{

Callers 1

GetMethod · 0.80

Calls 3

RegReadStringFunction · 0.85
IsWinNTMethod · 0.80
IsWin2000orLaterMethod · 0.80

Tested by

no test coverage detected