Code:
Private Declare Function GetModuleHandle Lib _
"kernel32" Alias "GetModuleHandleA" ( _
ByVal lpModuleName As String) As Long
Private Declare Function LoadLibrary Lib _
"kernel32" Alias "LoadLibraryA" ( _
ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib _
"kernel32" (ByVal hModule As Long, _
ByVal lpProcName As String) As Long
Private Declare Function FreeLibrary Lib _
"kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function IsWow64Process Lib "kernel32" (ByVal hProcess As Long, ByRef Wow64Process As Long) As Long
Function IsX64b() As Boolean
Dim hMod As Long
hMod = GetModuleHandle("ntdll.dll")
If GetProcAddress(hMod, "ZwWow64ReadVirtualMemory64") Then
IsX64b = True
End If
End Function
Function IsX64() As Boolean
Dim lngReturn As Long
'GetCurrentProcess
Call IsWow64Process(-1, lngReturn)
IsX64 = lngReturn <> 0
End Function