Option Explicit'Primary Language   Locale Name                 LCID        Win CP  DOS CP
'Albanian           Albania                     (041c; SQI)
'Basque             Basque                      (042D; EUQ) 1252    850
'Byelorussian       Byelorussia                 (0423, BEL) 1251    866
'Bulgarian          Bulgaria                    (0402, BGR) 1251    866
'Catalan            Catalan                     (0403; CAT) 1252    850
'Croatian           Croatian                    (041a, SHL) 1250    852
'Czech              Czech                       (0405; CSY) 1250    852
'Danish             Danish                      (0406; DAN) 1252    865
'Dutch (2):         Dutch (Standard)            (0413; NLD) 1252    850
'Dutch (2):         Belgian (Flemish)           (0813; NLB) 1252    850
'English (6):       American                    (0409; ENU) 1252    437
'English (6):       British                     (0809; ENG) 1252    850
'English (6):       Australian                  (0c09; ENA) 1252    850
'English (6):       Canadian                    (1009; ENC) 1252    850
'English (6):       New Zealand                 (1409; ENZ) 1252    850
'English (6):       Ireland                     (1809; ENI) 1252    850
'Estonian           Estonia                     (0425, ETI) 1257    775
'Finnish            Finnish                     (040b; FIN) 1252    850
'French             French (Standard)           (040c; FRA) 1252    850
'French             Belgian                     (080c; FRB) 1252    850
'French             Canadian                    (0c0c; FRC) 1252    850
'French             Swiss                       (100c; FRS) 1252    850
'French             Luxembourg                  (140c; FRL) 1252    850
'German             German (Standard)           (0407; DEU) 1252    850
'German             Swiss                       (0807; DES) 1252    850
'German             Austrian                    (0c07; DEA) 1252    850
'German             Luxembourg                  (1007; DEL) 1252    850
'German             Liechtenstein               (1407; DEC) 1252    850
'Greek              Greek                       (0408; ELL) 1253    737 or 8694
'Hungarian          Hungarian                   (040e; HUN) 1250    852
'Icelandic          Icelandic                   (040F; ISL) 1252    850
'Italian (2):       Italian (Standard)          (0410; ITA) 1252    850
'Italian (2):       Swiss                       (0810; ITS) 1252    850
'Latvian            Latvia                      (0426, LVI) 1257    775
'Lithuanian         Lithuania                   (0427, LTH) 1257    775
'Norwegian (2):     Norwegian (Bokmal)          (0414; NOR) 1252    850
'Norwegian (2):     Norwegian (Nynorsk)         (0814; NON) 1252    850
'Polish             Polish                      (0415; PLK) 1250    852
'Portuguese (2):    Portuguese (Brazilian)      (0416; PTB) 1252    850
'Portuguese (2):    Portuguese (Standard)       (0816; PTG) 1252    850
'Romanian (2):      Romania                     (0418, ROM) 1250    852
'Russian            Russian                     (0419; RUS) 1251    866
'Slovak             Slovak                      (041b; SKY) 1250    852
'Slovenian          Slovenia                    (0424, SLV) 1250    852
'Spanish (3):       Spanish (Traditional Sort)  (040a; ESP) 1252    850
'Spanish (3):       Mexican                     (080a; ESM) 1252    850
'Spanish (3):       Spanish (Modern Sort)       (0c0a; ESN) 1252    850
'Swedish            Swedish                     (041D; SVE) 1252    850
'Turkish            Turkish                     (041f; TRK) 1254    857
'Ukrainian          Ukraine                     (0422, UKR) 1251    866
Private Const ANSI_CHARSET = 0
Private Const DEFAULT_CHARSET = 1
Private Const SYMBOL_CHARSET = 2
Private Const SHIFTJIS_CHARSET = 128
Private Const HANGEUL_CHARSET = 129
Private Const HANGUL_CHARSET = 129
Private Const GB2312_CHARSET = 134
Private Const CHINESEBIG5_CHARSET = 136
Private Const OEM_CHARSET = 255
Private Const JOHAB_CHARSET = 130
Private Const HEBREW_CHARSET = 177
Private Const ARABIC_CHARSET = 178
Private Const GREEK_CHARSET = 161
Private Const TURKISH_CHARSET = 162
Private Const VIETNAMESE_CHARSET = 163
Private Const THAI_CHARSET = 222
Private Const EASTEUROPE_CHARSET = 238
Private Const RUSSIAN_CHARSET = 204
Private Const MAC_CHARSET = 77
Private Const BALTIC_CHARSET = 186Private Declare Function GetUserDefaultLCID Lib "kernel32" () As LongPrivate Declare Function GetThreadLocale Lib "kernel32" () As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
   (ByVal lpLibFileName As String) As Long
Private Declare Function LoadString Lib "user32" Alias "LoadStringA" _
   (ByVal hInstance As Long, ByVal wID As Long, ByVal lpBuffer As String, _
    ByVal nBufferMax As Long) As Long
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" _
   (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, _
    ByVal cchData As Long) As LongPrivate Const LOCALE_IDEFAULTANSICODEPAGE = &H1004&
Private Const LOCALE_SENGCOUNTRY = &H1002
Private Const LOCALE_SNATIVECTRYNAME = &H8
Private Const LOCALE_SCOUNTRY = &H6Private Const THIS_LOCALID = &H408Function GetCharSet(sCdpg As String) As Integer
   Select Case sCdpg
      Case "932" ' Japanese
         GetCharSet = SHIFTJIS_CHARSET
      Case "936" ' Simplified Chinese
         GetCharSet = GB2312_CHARSET
      Case "949" ' Korean
         GetCharSet = HANGEUL_CHARSET
      Case "950" ' Traditional Chinese
         GetCharSet = CHINESEBIG5_CHARSET
      Case "1250" ' Eastern Europe
         GetCharSet = EASTEUROPE_CHARSET
      Case "1251" ' Russian
         GetCharSet = RUSSIAN_CHARSET
      Case "1252" ' Western European Languages
         GetCharSet = ANSI_CHARSET
      Case "1253" ' Greek
         GetCharSet = GREEK_CHARSET
      Case "1254" ' Turkish
         GetCharSet = TURKISH_CHARSET
      Case "1255" ' Hebrew
         GetCharSet = HEBREW_CHARSET
      Case "1256" ' Arabic
         GetCharSet = ARABIC_CHARSET
      Case "1257" ' Baltic
         GetCharSet = BALTIC_CHARSET
      Case Else
         GetCharSet = 0
   End Select
End Function
Function StripNullTerminator(sCP As String)
   Dim posNull As Long
   posNull = InStr(sCP, Chr$(0))
   StripNullTerminator = Left$(sCP, posNull - 1)
End Function
Private Sub Form_Load()
   Dim hInst As Long, lResult As Long, x As Long
   Dim LCID As Long, sLcid As String
   Dim resString As String * 255
   Dim sCodePage As String   sCodePage = String$(16, " ")
   Label1.AutoSize = True
   Label1.Caption = ""   LCID = GetThreadLocale() 'Get Current locale
   
   Dim lLocalID As Long
   
   ' Find the LocalID.
   lLocalID = GetUserDefaultLCID
   
   '实际上,这两个函数返回是一样的!!!!
   Debug.Assert LCID = lLocalID
   
   sLcid = Hex$(Trim$(CStr(LCID))) 'Convert to Hex
   ' Display decimal value of the LCID (Hex in Parentheses)
   Form1.Caption = "LCID " & LCID & " (" & sLcid & ")"
   x = GetLocaleInfo(LCID, LOCALE_IDEFAULTANSICODEPAGE, _
       sCodePage, Len(sCodePage))  'Get code page
   sCodePage = StripNullTerminator(sCodePage)
   ' Load dll with string table resource.
   ' Might need to change path for the resdll.
   hInst = LoadLibrary("resdll" & sLcid & ".dll")   ' Get string with ID 101.
   lResult = LoadString(hInst, 101, resString, 255)
   With Label1.Font
      .Name = "Lucida Sans Unicode"
      .Size = 14
      .Charset = GetCharSet(sCodePage)  'Convert code page to charset
   End With
   ' Display the localized string.
   Label1.Caption = resString
   
   With Text1.Font
    .Name = "Tahoma"
    .Charset = SYMBOL_CHARSET
    .Size = 14
   End With
   
   Dim strShow As String
   
   strShow = StrConv(Chr(264) & Chr(265) & Chr(284) & Chr(285) & Chr(292) & Chr(293) & Chr(308) & Chr(309) & Chr(348) & Chr(349) & Chr(364) & Chr(365), vbFromUnicode, lLocalID)
    
   Text1.Text = strShow
   
   
End Sub

解决方案 »

  1.   

    主  题:想念CSDN的磨牙茶社~~~~~~~
    作  者:luocc
    所属论坛:Visual Basic
    问题点数:0
    回复次数:5
    发表时间:2002-1-24 11:08:35
     
      
      好想念CSDN的磨牙茶社呀,阿木,老山,老妖,吴文智,你们在不在呀?好久都不见你们浮头了~~~~~~~~ 
    回复贴子: 
    回复人: uguess(uguess) (2002-1-24 11:11:48)  得0分   对对,没想到还有人记得!~
      他们好像都转到军营去了。
     
    回复人: Jneu(沧海桑田) (2002-1-24 11:13:01)  得0分 
    吴文智,老山,包香都让dbcontrols
    给气跑了~,接下来又不知道轮到谁了呢?  
    回复人: Jneu(沧海桑田) (2002-1-24 11:26:14)  得0分 
    欢迎到军营(www.jinesc.com)看看~  
    回复人: luocc(罗) (2002-1-24 11:27:38)  得0分 
    to Jneu(沧海桑田):气跑了?不是吧~~~~~,知道去哪里找他们吗?
    to uguess(uguess):我当然记得了,可惜~~~~~~~~~~,可恶的dbcontrols!!!
    这儿高手越来越少啦了~~~~~~~~~
     
    回复人: Jneu(沧海桑田) (2002-1-24 11:32:36)  得0分 
    主  题:dbcontrols终于要走了~
    ★baoxiang★ 星期六上校 ¦ 回复时间:2002-1-22 -13:54:57    LAUGH 
    这个混蛋终于滚了。 
    看来我要考虑是不是回去看看。 
     
      

  2.   

    主  题:想念CSDN的磨牙茶社~~~~~~~
    作  者:luocc
    所属论坛:Visual Basic
    问题点数:0
    回复次数:5
    发表时间:2002-1-24 11:08:35
     
      
      好想念CSDN的磨牙茶社呀,阿木,老山,老妖,吴文智,你们在不在呀?好久都不见你们浮头了~~~~~~~~ 
    回复贴子: 
    回复人: uguess(uguess) (2002-1-24 11:11:48)  得0分   对对,没想到还有人记得!~
      他们好像都转到军营去了。
     
    回复人: Jneu(沧海桑田) (2002-1-24 11:13:01)  得0分 
    吴文智,老山,包香都让dbcontrols
    给气跑了~,接下来又不知道轮到谁了呢?  
    回复人: Jneu(沧海桑田) (2002-1-24 11:26:14)  得0分 
    欢迎到军营(www.jinesc.com)看看~  
    回复人: luocc(罗) (2002-1-24 11:27:38)  得0分 
    to Jneu(沧海桑田):气跑了?不是吧~~~~~,知道去哪里找他们吗?
    to uguess(uguess):我当然记得了,可惜~~~~~~~~~~,可恶的dbcontrols!!!
    这儿高手越来越少啦了~~~~~~~~~
     
    回复人: Jneu(沧海桑田) (2002-1-24 11:32:36)  得0分 
    主  题:dbcontrols终于要走了~
    ★baoxiang★ 星期六上校 ¦ 回复时间:2002-1-22 -13:54:57    LAUGH 
    这个混蛋终于滚了。 
    看来我要考虑是不是回去看看。