Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
getlocaleinfo (kernel32)

C# Signature:

[DllImport("kernel32.dll", SetLastError = true)]
static extern int GetLocaleInfo(uint Locale, uint LCType,
   [Out] StringBuilder lpLCData, int cchData);

VB>NET Signature:

<DllImport("kernel32.dll", SetLastError:=True)>
Public Shared Function GetLocaleInfo(ByVal locale As UInteger, ByVal LCType As UInteger, <Out()> ByVal lpLCData As System.Text.StringBuilder, ByVal cchData As Integer) As Integer
End Function

User-Defined Types:




Tips & Tricks:

Use GetLocaleInfoEx instead

Please add some!

Sample Code:

public static SysConfig GetSystemConfiguration()


    var sepDecimal = new StringBuilder();
    GetLocaleInfo(0x0C00, 0xE, sepDecimal, 99);

    var sepGrupo = new StringBuilder();
    GetLocaleInfo(0x0C00, 0xF, sepGrupo, 99);

    var datePattern = new StringBuilder();
    GetLocaleInfo(0x0C00, 0x1F, datePattern, 99);

    return new SysConfig
    NumberDecimalSeparator = sepDecimal.ToString(),
    NumberGroupSeparator = sepGrupo.ToString(),
    ShortDatePattern = datePattern.ToString()


public class SysConfig


    public string NumberDecimalSeparator { get; set; }
    public string NumberGroupSeparator { get; set; }
    public string ShortDatePattern { get; set; }


Alternative Managed API:

Do you know one? Please contribute it!


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version