1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
' Constantes Paramètres régionaux.
' Mutuellement exclusives - Ne pas combiner les constantes
'
Const LOCALE_ILANGUAGE As Long = &H1 ' language id
Const LOCALE_SLANGUAGE As Long = &H2 ' localized name of language
Const LOCALE_SENGLANGUAGE As Long = &H1001 ' English name of language
Const LOCALE_SABBREVLANGNAME As Long = &H3 ' abbreviated language name
Const LOCALE_SNATIVELANGNAME As Long = &H4 ' native name of language
Const LOCALE_ICOUNTRY As Long = &H5 ' country code
Const LOCALE_SCOUNTRY As Long = &H6 ' localized name of country
Const LOCALE_SENGCOUNTRY As Long = &H1002 ' English name of country
Const LOCALE_SABBREVCTRYNAME As Long = &H7 ' abbreviated country name
Const LOCALE_SNATIVECTRYNAME As Long = &H8 ' native name of country
Const LOCALE_IDEFAULTLANGUAGE As Long = &H9 ' default language id
Const LOCALE_IDEFAULTCOUNTRY As Long = &HA ' default country code
Const LOCALE_IDEFAULTCODEPAGE As Long = &HB ' default oem code page
Const LOCALE_IDEFAULTANSICODEPAGE As Long = &H1004 ' default ansi code page
Const LOCALE_IDEFAULTMACCODEPAGE As Long = &H1011 ' default mac code page
Const LOCALE_SLIST As Long = &HC ' list item separator
Const LOCALE_IMEASURE As Long = &HD ' 0 = metric, 1 = US
Const LOCALE_SDECIMAL As Long = &HE ' decimal separator
Const LOCALE_STHOUSAND As Long = &HF ' thousand separator
Const LOCALE_SGROUPING As Long = &H10 ' digit grouping
Const LOCALE_IDIGITS As Long = &H11 ' number of fractional digits
Const LOCALE_ILZERO As Long = &H12 ' leading zeros for decimal
Const LOCALE_INEGNUMBER As Long = &H1010 ' negative number mode
Const LOCALE_SNATIVEDIGITS As Long = &H13 ' native ascii 0-9
Const LOCALE_SCURRENCY As Long = &H14 ' local monetary symbol
Const LOCALE_SINTLSYMBOL As Long = &H15 ' intl monetary symbol
Const LOCALE_SMONDECIMALSEP As Long = &H16 ' monetary decimal separator
Const LOCALE_SMONTHOUSANDSEP As Long = &H17 ' monetary thousand separator
Const LOCALE_SMONGROUPING As Long = &H18 ' monetary grouping
Const LOCALE_ICURRDIGITS As Long = &H19 ' # local monetary digits
Const LOCALE_IINTLCURRDIGITS As Long = &H1A ' # intl monetary digits
Const LOCALE_ICURRENCY As Long = &H1B ' positive currency mode
Const LOCALE_INEGCURR As Long = &H1C ' negative currency mode
Const LOCALE_SDATE As Long = &H1D ' date separator
Const LOCALE_STIME As Long = &H1E ' time separator
Const LOCALE_SSHORTDATE As Long = &H1F ' short date format string
Const LOCALE_SLONGDATE As Long = &H20 ' long date format string
Const LOCALE_STIMEFORMAT As Long = &H1003 ' time format string
Const LOCALE_IDATE As Long = &H21 ' short date format ordering
Const LOCALE_ILDATE As Long = &H22 ' long date format ordering
Const LOCALE_ITIME As Long = &H23 ' time format specifier
Const LOCALE_ITIMEMARKPOSN As Long = &H1005 ' time marker position
Const LOCALE_ICENTURY As Long = &H24 ' century format specifier (short date)
Const LOCALE_ITLZERO As Long = &H25 ' leading zeros in time field
Const LOCALE_IDAYLZERO As Long = &H26 ' leading zeros in day field (short date)
Const LOCALE_IMONLZERO As Long = &H27 ' leading zeros in month field (short date)
Const LOCALE_S1159 As Long = &H28 ' AM designator
Const LOCALE_S2359 As Long = &H29 ' PM designator
Const LOCALE_ICALENDARTYPE As Long = &H1009 ' type of calendar specifier
Const LOCALE_IOPTIONALCALENDAR As Long = &H100B ' additional calendar types specifier
Const LOCALE_IFIRSTDAYOFWEEK As Long = &H100C ' first day of week specifier
Const LOCALE_IFIRSTWEEKOFYEAR As Long = &H100D ' first week of year specifier
Const LOCALE_SDAYNAME1 As Long = &H2A ' long name for Monday
Const LOCALE_SDAYNAME2 As Long = &H2B ' long name for Tuesday
Const LOCALE_SDAYNAME3 As Long = &H2C ' long name for Wednesday
Const LOCALE_SDAYNAME4 As Long = &H2D ' long name for Thursday
Const LOCALE_SDAYNAME5 As Long = &H2E ' long name for Friday
Const LOCALE_SDAYNAME6 As Long = &H2F ' long name for Saturday
Const LOCALE_SDAYNAME7 As Long = &H30 ' long name for Sunday
Const LOCALE_SABBREVDAYNAME1 As Long = &H31 ' abbreviated name for Monday
Const LOCALE_SABBREVDAYNAME2 As Long = &H32 ' abbreviated name for Tuesday
Const LOCALE_SABBREVDAYNAME3 As Long = &H33 ' abbreviated name for Wednesday
Const LOCALE_SABBREVDAYNAME4 As Long = &H34 ' abbreviated name for Thursday
Const LOCALE_SABBREVDAYNAME5 As Long = &H35 ' abbreviated name for Friday
Const LOCALE_SABBREVDAYNAME6 As Long = &H36 ' abbreviated name for Saturday
Const LOCALE_SABBREVDAYNAME7 As Long = &H37 ' abbreviated name for Sunday
Const LOCALE_SMONTHNAME1 As Long = &H38 ' long name for January
Const LOCALE_SMONTHNAME2 As Long = &H39 ' long name for February
Const LOCALE_SMONTHNAME3 As Long = &H3A ' long name for March
Const LOCALE_SMONTHNAME4 As Long = &H3B ' long name for April
Const LOCALE_SMONTHNAME5 As Long = &H3C ' long name for May
Const LOCALE_SMONTHNAME6 As Long = &H3D ' long name for June
Const LOCALE_SMONTHNAME7 As Long = &H3E ' long name for July
Const LOCALE_SMONTHNAME8 As Long = &H3F ' long name for August
Const LOCALE_SMONTHNAME9 As Long = &H40 ' long name for September
Const LOCALE_SMONTHNAME10 As Long = &H41 ' long name for October
Const LOCALE_SMONTHNAME11 As Long = &H42 ' long name for November
Const LOCALE_SMONTHNAME12 As Long = &H43 ' long name for December
Const LOCALE_SABBREVMONTHNAME1 As Long = &H44 ' abbreviated name for January
Const LOCALE_SABBREVMONTHNAME2 As Long = &H45 ' abbreviated name for February
Const LOCALE_SABBREVMONTHNAME3 As Long = &H46 ' abbreviated name for March
Const LOCALE_SABBREVMONTHNAME4 As Long = &H47 ' abbreviated name for April
Const LOCALE_SABBREVMONTHNAME5 As Long = &H48 ' abbreviated name for May
Const LOCALE_SABBREVMONTHNAME6 As Long = &H49 ' abbreviated name for June
Const LOCALE_SABBREVMONTHNAME7 As Long = &H4A ' abbreviated name for July
Const LOCALE_SABBREVMONTHNAME8 As Long = &H4B ' abbreviated name for August
Const LOCALE_SABBREVMONTHNAME9 As Long = &H4C ' abbreviated name for September
Const LOCALE_SABBREVMONTHNAME10 As Long = &H4D ' abbreviated name for October
Const LOCALE_SABBREVMONTHNAME11 As Long = &H4E ' abbreviated name for November
Const LOCALE_SABBREVMONTHNAME12 As Long = &H4F ' abbreviated name for December
' Fonction API Windows pour interroger les paramètres régionnaux
Private Declare Function GetLocaleInfo Lib "kernel32.dll" Alias "GetLocaleInfoA" _
(ByVal Lcl As Long, ByVal LCType As Long, ByVal buffer As String, ByVal buffsize As Integer) As Long
Sub testLocal()
Dim buff As String, RetVal As Long, KEY As Long, RetStr As String
Const LOCALE_USER_DEFAULT As Long = &H400 ' Paramètres par défault utilisateur en cours
Const LOCALE_SYSTEM_DEFAULT As Long = &H800 ' Paramètres par défault du système
KEY = LOCALE_USER_DEFAULT
buff = String(512, vbNullChar)
RetVal = GetLocaleInfo(KEY, LOCALE_SENGLANGUAGE, buff, 510) ' Langage en anglais
RetStr = Left(buff, RetVal - 1)
RetVal = GetLocaleInfo(KEY, LOCALE_SABBREVLANGNAME, buff, 510) ' abbreviated language name
RetStr = Left(buff, RetVal - 1)
RetVal = GetLocaleInfo(KEY, LOCALE_SENGCOUNTRY, buff, 510) ' English name of country
RetStr = Left(buff, RetVal - 1)
RetVal = GetLocaleInfo(KEY, LOCALE_SDATE, buff, 510) ' Séparateur date
RetStr = Left(buff, RetVal - 1)
RetVal = GetLocaleInfo(KEY, LOCALE_SMONTHNAME4, buff, 510) ' Avril
RetStr = Left(buff, RetVal - 1)
End Sub |
Partager