Reputation: 203
I want to change the default language for windows system. From powershell, there is a way to do this using
Set-WinUILanguageOverride -Language de-DE
(Changes language to German)
However, I am looking for a win32 api call for same. Tried SetLocaleInfo
, but it wasn't working.The following code prints 0 as the SetLocaleInfo is failing. GetLastError()
returned ERROR_INVALID_FLAGS
, but not sure which flag needs to go here. Thanks.
int main()
{
LCID lcid = GetSystemDefaultLCID();
cout << "system default >> " << lcid << endl;
wstring regionCode;
//Tatar Russia
lcid = 1092;
regionCode = L"0x0444";
cout << "Tatar Russia " << SetLocaleInfo(lcid, LOCALE_FONTSIGNATURE | LOCALE_SISO639LANGNAME, regionCode.c_str()) << endl;
return 0;
}
Upvotes: 0
Views: 881
Reputation: 3890
As @Petesh said, The two LCType
you used are invalid for the SetLocaleInfo
function,and there is no valid flag for SetLocaleInfo
that can set the UI language of windows system.
According to the User Interface Language Management
:
User UI Language
To retrieve the user UI language, an application can call
GetUserDefaultUILanguage
orGetUserPreferredUILanguages
. The application cannot change the user UI language, as there is no function to set it.
Therefore, there is no suitable Windows32 API that can modify the UI language of the windows system.
Upvotes: 1