How to switch language on a device from running app?

      How to switch language on a device from running app?

      Hi,
      I'm developping a multi-linguages application in VB.net.
      I'm using a resource-file containing two languages.
      I need to switch between languages like French and Italian from within an application.
      I can change the language via SetUserDefaultLCID, but that didn't work immediatelly - i had to
      restart the application.

      I use this code (VB):

      Declare Function SetUserDefaultLCID Lib "coredll.dll" (ByVal LCID As Integer) As Boolean
      Declare Function GetUserDefaultLCID Lib "coredll.dll" () As Integer

      SetUserDefaultLCID(1040) ' switch to Italian
      SetUserDefaultLCID(4108) ' switch to french

      Thanks

      Re: How to switch language on a device from running app?

      Hello,
      as far as i see from MSDN you have to post a message:

      Source Code

      1. PostMessage(HWND_BROADCAST, WM_WININICHANGE, 0, INI_INTL);
      for update applications (immediatelly).
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

      Re: How to switch language on a device from running app?

      Hello,

      I have the same problem. I can switch the language only with a Reset.
      It seems that the PostMessage has no effect.

      Source Code

      1. [DllImport("coredll.dll", SetLastError = true)]
      2. static extern bool SetUserDefaultLCID(Int32 LoCaleID);
      3. [DllImport("coredll.dll", SetLastError = true)]
      4. static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
      5. private const int HWND_BROADCAST = 0xffff;
      6. private const int WM_WININICHANGE = 0x001a;
      7. private const int INI_INTL = 1;
      8. public void Language(int language)
      9. {
      10. SetUserDefaultLCID(language);
      11. PostMessage((System.IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0, INI_INTL);
      12. }


      Has anyone an idea?

      Re: How to switch language on a device from running app?

      Yes, MUI ist disabled.

      I have the following settings:

      Source Code

      1. !>reg open \mui<LF>
      2. OK
      3. !>reg enum<LF>
      4. OK -> reg enum value \
      5. 00 "Enable"=dword:0 \
      6. 01 "SysLang"=dword:1033 \
      7. OK
      8. !>reg open \nls<LF>
      9. OK
      10. !>reg enum<LF>
      11. OK -> reg enum key \
      12. 00 "overrides" \
      13. OK -> reg enum value \
      14. 00 "DefaultLCID"=dword:1033 \
      15. 01 "ExtraCurrency"=dword:8364 \
      16. !>reg opencu \mui<LF>
      17. OK
      18. !>reg enum<LF>
      19. OK -> reg enum key \
      20. OK -> reg enum value \
      21. 00 "Enable"=dword:0 \
      22. 01 "CurLang"=dword:1033 \
      23. OK
      24. !>


      Where is the value (SetUserDefaultLCID) in the registry stored?