form1.frm

来自「150个经典VB API应用实例.全部是运用API写的小程序」· FRM 代码 · 共 49 行

FRM
49
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   2  '屏幕中心
   Visible         =   0   'False
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'The GetVersion function returns the operating system in use.
Private Declare Function GetVersion Lib "kernel32" () As Long

Private Sub Form_Load()
'********************************************************************
'* When the project starts, check the operating system used by
'* calling the GetVersion function.
'********************************************************************
    Dim lngVersion As Long
    lngVersion = GetVersion()
    Dim strVersion As String
    strVersion = "Unknown OS"
    If ((lngVersion And &H80000000) = 0) Then
        If ((lngVersion And &HF) = 3) Then
            strVersion = "Windows NT 3.51"
        ElseIf ((lngVersion And &HF) = 4) Then
            strVersion = "Windows NT 4.0"
        ElseIf ((lngVersion And &HF) = 5) Then
            strVersion = "Windows 2000 or Windows XP"
        End If
    ElseIf ((lngVersion And &H80000000) = 1) Then
        If ((lngVersion And &HF) = 3) Then
            strVersion = "Win32s with Windows 3.1"
        ElseIf ((lngVersion And &HF) = 4) Then
            strVersion = "Windows 95, Windows 98, or Windows Me"
        End If
    End If
    MsgBox strVersion
    Unload Me
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?