CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    12

    How to change a System Code Page?

    Hi,

    How can I change the System Code Page from my application?
    I'm not just talking about the individual Time/Date/Currency/Measure/Weight/etc. formats, but the system code page.

    What I actually want to do is to change the code page in such a way that all processes and windows are notified of this code page change.

    The only idea I have is to change the system default code page, and then broadcast a WM_SETTINGCHANGE. Is this a correct way? I don't know how to do it.

    Help, anyone?

    Regards,
    Ming_Wah THAM


  2. #2
    Guest

    Re: How to change a System Code Page?

    Hi,

    Look into the function: SetLocaleInfo() and MAKELCID(), both are needed to create a Custom Locale with the pre-sets you desire.


  3. #3
    Join Date
    May 1999
    Posts
    12

    Re: How to change a System Code Page?

    Hi,

    I checked up the SetLocaleInfo() function. Perhaps I've read wrongly, but this function could only set certain "UserOverrideable" LCTYPEs, which are the Time/Currency/Weight/Measures/etc...
    Moreover, I tried writing a small piece of code to try it out, and I found that the Regional Setting in the Control Panel remains unchanged. This cause me to think that perhaps SetLocaleInfo changes only the Locale for my program alone? I may be wrong, of course.

    Although using GetLocaleInfo(), I could obtain the DefaultLangID, DefaultLocaleID and DefaultCodePage, these values cannot be changed by SetLocaleInfo. They are not in the "UserOverrideable" list.
    I've search high and low in the documentation, but I couldn't find anything that could enable me to change the System Default Locale Settings, ie, the Language setting in the Regional Settings applet of the Control Panel.

    Let me state more specifically what I want to do. Suppose that in the normal English Windows, the Regional Settings is "English (United States)". Now when my program starts up, I would like it to programmatically change the setting to, say, "French (Standard), or "German (Swiss)", depending on the choice of the user. My program allows the user to change the Regional Settings without going into the Control Panel. And after making this change, the new Regional settings must be known to all existing and new windows in the system. When my program exits, it will change the settings back to "English (United States)".

    I know this can be done, because I've seen Japanese programs automatically changing my Regional Settings into "Japanese(Kanji)" during the duration of the program, and then reverting on exit.

    I just don't know how to do it. *sigh* Please help. Thanx.

    Regards,
    Ming_Wah THAM.



  4. #4
    Join Date
    Jun 2001
    Location
    Trondheim, Norway
    Posts
    14
    This is exactly what I'm looking for also, I'd like to change the System Locale setting in Windows 2000 programmatically.

    Is this possible at all??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured