CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Location
    The Netherlands
    Posts
    32

    [Windows 7] Change user's regional settings

    I was advised to open a new topic in the C# corner

    For more information and the prequel, please check out this topic:
    http://www.codeguru.com/forum/showthread.php?t=516737

    What i want to do is change the regional settings of an user on Windows 7 / Server 2008 (already got it working on 9x).

    Thus, this setting:
    http://www.jdsoft.nl/_images/setloc.png

    It seems you can do this by using the SetLocaleInfo function:
    http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx

    But i'm not sure how to do this and how to use the function, can someone steer me into the right direction here?

    What i have so far is this:

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Globalization;
    using System.Runtime.InteropServices;
    
    namespace SetSaf6x
    {
        class Program
        {
            [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
            public static extern bool SetLocaleInfo(int Locale, int LCType, string lpLCData);
    
            static void Main(string[] args)
            {
                //SetLocaleInfo(something, something, "something");
            }
        }
    }
    Thank you very much!

  2. #2
    Join Date
    Sep 2011
    Location
    The Netherlands
    Posts
    32

    Re: [Windows 7] Change user's regional settings

    *kick* anyone?

    It looks like SetLocaleInfo is't the way to go, but i wonder where to look next then.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: [Windows 7] Change user's regional settings

    Generally it isn't advisable for programs to change user settings.

    I have to wonder why you feel your program should do this.

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