Re: [Emergency!] How to set system default language by code?

From: Ferdinand Oeinck (ferdo_at_nospam.bigroses.demon.nl)
Date: 02/12/04


Date: Thu, 12 Feb 2004 13:05:24 +0100

I use:

char szLang[32];
char szCountry[32];
char szCodePage[32];

if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE,
    szLang, sizeof(szLang)) > 0)
{
    if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGCOUNTRY,
        szCountry, sizeof(szCountry)) > 0)
    {
        if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE,
            szCodePage, sizeof(szCodePage)) > 0)
        {
            CString loc;
            loc.Format("%s_%s.%s", szLang, szCountry, szCodePage);
            setlocale(LC_ALL, loc);
        }
    }
}

Ferdinand.

"WizardLee" <WizardLeeCN@hotmail.com> wrote in message
news:exwzKUK8DHA.1816@TK2MSFTNGP12.phx.gbl...
> Hi, all,
>
>
> A new feature is required to add to my program today. But I do not have
any
> idea about it.
> The feature should implement these two functions:
>
> 1, Select "Install files for East Asia languages" in control panel
> applet "Regional and Language Option" in "Language" tabpage, then apply;
>
> 2, According to user's selection, choose "Chinese (PRC)" or "Chinese
> (TaiWan)" or something else for "Non-unicode application language" in
> "Advanced" tabpage, then apply;
>
> This feature may require Windows setup CD and may need reboot.
>
>
> Thans very very very much!
> WizardLee
>
>



Relevant Pages

  • Re: new IL: C (sort of...).
    ... multiple integer and char types? ... (requires floats in many places) ... Is it important enough language feature to keep or implement in his IL? ... E.g., by choosing all characters to be "unsigned char," he can eliminate ...
    (comp.lang.misc)
  • Re: Illegal internal write?
    ... I think it is -- both in the feature itself, ... char*), would require the prototype. ... representation; in C89/90 this is nonnormatively 'intended' to allow ... OTOH, FILE in practice almost always is a struct, although not ...
    (comp.lang.fortran)
  • Re: Fortran Features
    ... On the assumption that no feature should ... language and find it not nearly as useful as I expected. ... I don't find text labels all that useful where we already have them. ... You mean like overloading CHAR so that it takes ...
    (comp.lang.fortran)
  • Char Char Char Styles in Word 2002
    ... I read Susan Barnhill's response to a user with the "char char ... I understand this char style problem is ... "corrupt" in order to get rid of the styles is totally unacceptable. ... is a feature Microsoft has put into their program, they need to come up with ...
    (microsoft.public.word.pagelayout)
  • Re: [Emergency!] How to set system default language by code?
    ... char szCodePage; ... szLang, sizeof)> 0) ... Ferdinand. ... > A new feature is required to add to my program today. ...
    (microsoft.public.vc.mfc)