Change Windows display language from .Net

Mujahid Desai 41 Reputation points
2021-11-25T11:20:11.923+00:00

Is there any API available to change windows display language? I want to update system setting.

Windows development Windows API - Win32
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,681 Reputation points
    2021-11-25T16:44:36.027+00:00

    A way is to use Powershell Automation

    Tested on Windows 10 21H1 (need reconnection) :

                    // Add reference to : "C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll"
    
                    // Should use Get-WinUserLanguageList to get the list
                    string sLanguage = "en-US";
                    using (var ps = PowerShell.Create())
                    {
                        string sCommand = string.Format(@"Set-WinUILanguageOverride -Language {0}", sLanguage);
                        ps.AddScript(sCommand);
                        Collection<PSObject> results = ps.Invoke();
                    }
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.