システム情報を取得          <TOP>


システム情報(プロセッサのタイプ)を取得します。

GetSystemInfo システム情報を取得する関数

 

VL100/2(WindowsXP/AMD)

FLORA(Windows98/PentiumMMX)

MATE(Windows2000/Pentium)

 

'================================================================
'= プロセッサのタイプを取得
'=     (GetSystemInfo.bas)
'================================================================
#include "Windows.bi"

Type SYSTEM_INFO
'    dwOemId                     As Long
    wProcessorArchitecture       As Integer
    wReserved                    As Integer
    dwPageSize                   As Long
    lpMinimumApplicationAddress  As Long
    lpMaximumApplicationAddress  As Long
    dwActiveProcessorMask        As Long
    dwNumberOfProcessors         As Long
    dwProcessorType              As Long
    dwAllocationGranularity      As Long
    wProcessorLevel              As Integer
    wProcessorRevision           As Integer
End Type

#define PROCESSOR_ARCHITECTURE_INTEL 0  '
#define PROCESSOR_INTEL_386 386         '
#define PROCESSOR_INTEL_486 486         '
#define PROCESSOR_INTEL_PENTIUM 586     '

' システム情報を取得
Declare Sub Api_GetSystemInfo Lib "Kernel32" Alias "GetSystemInfo" (lpSystemInfo As SYSTEM_INFO)

Var Shared List1 As Object
List1.Attach GetDlgItem("List1") : List1.SetFontSize 14

'================================================================
'=
'================================================================
Declare Sub Mainform_Start edecl ()
Sub Mainform_Start()
    Var si As SYSTEM_INFO

    'システム情報を取得
    Api_GetSystemInfo si

    List1.ResetContent

    'プロセッサ情報を表示
    Select Case si.wProcessorArchitecture
        Case PROCESSOR_ARCHITECTURE_INTEL
            List1.AddString "構造   :" & "INTEL"
        Case Else
            List1.AddString "構造   :" & "不明"
    End Select

    '数を表示
    List1.AddString "数    :" & Str$(si.dwNumberOfProcessors)

    'タイプを表示
    Select Case si.dwProcessorType
        Case PROCESSOR_INTEL_386
            List1.AddString "タイプ  :" & "386"
        Case PROCESSOR_INTEL_486
            List1.AddString "タイプ  :" & "486"
        Case PROCESSOR_INTEL_PENTIUM
            List1.AddString "タイプ  :" & "Pentium"
        Case Else
            List1.AddString "タイプ  :" & "不明"
    End Select

    'レベルを表示
    Select Case si.wProcessorLevel
        Case 3
            List1.AddString "レベル  :" & "80386"
        Case 4
            List1.AddString "レベル  :" & "80486"
        Case 5
            List1.AddString "レベル  :" & "Pentium"
        Case 6
            List1.AddString "レベル  :" & "Pentium Pro/Pentium U"
        Case Else
            List1.AddString "レベル  :" & "不明"
    End Select

    'リビジョンを表示
    List1.AddString "リビジョン:" & Str$(((si.wProcessorRevision And &HFF00) \ &HFF)) & "." & Str$((si.wProcessorRevision And &HFF))
End Sub

'================================================================
'=
'================================================================
While 1
    WaitEvent
Wend
Stop
End