Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function IsWow64Process Lib "kernel32" (ByVal hProc As Long, bWow64Process As Boolean) As Long
'判断本机是否为64位机
Public Function Is64bit() As Boolean
Dim handle As Long, bolFunc As Boolean
bolFunc = False
handle = GetProcAddress(GetModuleHandle("kernel32"), "IsWow64Process")
If handle > 0 Then
IsWow64Process GetCurrentProcess(), bolFunc
End If
Is64bit = bolFunc
End Function