Private Declare Function GetACP Lib "kernel32" () As Long
Private Declare Function GetCPInfo Lib "kernel32" (ByVal CodePage As Long, _
lpCPInfo As CPINFO) As Long
Const CP_ACP = 0
Const MAX_DEFAULTCHAR = 2
Const MAX_LEADBYTES = 12 ' 5 ranges, 2 bytes ea., 0 term.
Private Type CPINFO
MaxCharSize As Long ' max length (Byte) of a char
DefaultChar(MAX_DEFAULTCHAR) As Byte ' default character
LeadByte(MAX_LEADBYTES) As Byte ' lead byte ranges
End Type
Dim Cpage As Long
Private Sub CmdACP_Click()
Cpage = GetACP()
MsgBox "현재 시스템의 ANSI 코드 페이지 ID : " & Cpage
End Sub
Private Sub CmdCPinfo_Click()
Dim lcp As CPINFO
Rtn = GetCPInfo(Cpage, lcp)
MsgBox "MaxCharSize : " & lcp.MaxCharSize & Chr(13) & _
"DefaultChar(0) : " & lcp.DefaultChar(0) & Chr(13) & _
"LeadByte(0) : " & lcp.LeadByte(0)
End Sub
Private Sub CmdExit_Click()
End
End Sub