form1.frm

来自「驱动级IO模拟按键」· FRM 代码 · 共 46 行

FRM
46
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   3000
      Left            =   2760
      Top             =   2040
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()

 If InitializeWinIo = False Then
  '用InitializeWinIo函数加载驱动程序,如果成功会返回true,否则返回false
    MsgBox "驱动程序加载失败!"
    Unload Me
 End If
Timer1.Interval = 3000
Timer1.Enabled = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
 ShutdownWinIo '程序结束时记得用ShutdownWinIo函数卸载驱动程序
End Sub

Private Sub Timer1_Timer()
Dim VK_A As Long
VK_A = &H41
MyKeyDown VK_A
MyKeyUp VK_A    '模拟按下并释放A键
End Sub


⌨️ 快捷键说明

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