Private Declare Function LCMapString Lib "kernel32" Alias "LCMapStringA" (ByVal Locale As Long, ByVal dwMapFlags As Long, ByVal lpSrcStr As String, ByVal cchSrc As Long, ByVal lpDestStr As String, ByVal cchDest As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Private Function J2F(ByVal strText As String) As String
'简体转繁体
Dim strF As String '繁体字符串
Dim strJ As String '简体字符串
Dim STlen As Long '待转换字串长度
strJ = strText
STlen = lstrlen(strJ)
strF = Space(STlen)
LCMapString &H804, &H4000000, strJ, STlen, strF, STlen
J2F = strF
End Function
Private Function F2J(ByVal strText As String) As String
'繁体转简体
Dim strF As String '繁体字符串
Dim strJ As String '简体字符串
Dim STlen As Long '待转换字串长度
strF = strText
STlen = lstrlen(strF)
strJ = Space(STlen)
LCMapString &H804, &H2000000, strF, STlen, strJ, STlen
F2J = strJ
End Function
Private Sub Command1_Click()
MsgBox J2F("简体字")
End Sub