[c++] vb判断系统是32位的 还是64位的

[复制链接]
梅雷工具箱发表于 2015-6-25 13:53:07 | 显示全部楼层 |阅读模式

'vb判断系统是32位的 还是64位的

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

      

Public Function Is64bit() As Boolean

    Dim handle As Long, bolFunc As Boolean

    ' Assume initially that this is not a Wow64 process

    bolFunc = False

    ' Now check to see if IsWow64Process function exists

    handle = GetProcAddress(GetModuleHandle("kernel32"), _
                   "IsWow64Process")

    If handle > 0 Then ' IsWow64Process function exists

        ' Now use the function to determine if

        ' we are running under Wow64

        IsWow64Process GetCurrentProcess(), bolFunc

    End If

    Is64bit = bolFunc

End Function

Private Sub Form_Load()
xt = Is64bit()
If xt = "True" Then
MsgBox "64位系统"
Else
MsgBox "32位系统"
End If

End Sub
_____________________________________________________________________________ _

中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/
就上UG网淘宝直营店
您需要登录后才可以回帖 登录 | 注册UG网 用百度帐号登录

本版积分规则