⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form3.frm

📁 捕获键盘操作的记录
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Frmkeylog 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查看记录"
   ClientHeight    =   6510
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9015
   Icon            =   "Form3.frx":0000
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6510
   ScaleWidth      =   9015
   StartUpPosition =   1  '所有者中心
   Begin MSComctlLib.ListView ListView1 
      Height          =   5175
      Left            =   0
      TabIndex        =   6
      Top             =   1320
      Width           =   9015
      _ExtentX        =   15901
      _ExtentY        =   9128
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      HoverSelection  =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483624
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.CommandButton Command1 
      Caption         =   "删除文件"
      DisabledPicture =   "Form3.frx":0442
      Height          =   615
      Index           =   1
      Left            =   720
      Picture         =   "Form3.frx":0884
      TabIndex        =   5
      Top             =   600
      UseMaskColor    =   -1  'True
      Width           =   1695
   End
   Begin MSComDlg.CommonDialog Cmdg 
      Left            =   3000
      Top             =   840
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DefaultExt      =   "dat"
      DialogTitle     =   "打开记录文件"
      FileName        =   "keylog.dat"
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开文件"
      Height          =   615
      Index           =   0
      Left            =   720
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   0
      UseMaskColor    =   -1  'True
      Width           =   1695
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      BackColor       =   &H80000018&
      Height          =   855
      Left            =   3360
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   1
      Top             =   480
      Visible         =   0   'False
      Width           =   5655
   End
   Begin VB.TextBox Text3 
      Appearance      =   0  'Flat
      BackColor       =   &H80000018&
      Height          =   495
      Left            =   3360
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   5655
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   1
      Left            =   120
      Picture         =   "Form3.frx":0CC6
      Stretch         =   -1  'True
      Top             =   600
      Width           =   495
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   4
      Left            =   120
      Picture         =   "Form3.frx":1108
      Stretch         =   -1  'True
      Top             =   0
      Width           =   495
   End
   Begin VB.Image Image1 
      Height          =   1335
      Index           =   0
      Left            =   3360
      Picture         =   "Form3.frx":154A
      Stretch         =   -1  'True
      Top             =   0
      Width           =   5655
   End
   Begin VB.Label Label2 
      Caption         =   "记录"
      Height          =   255
      Left            =   2880
      TabIndex        =   4
      Top             =   720
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Label Label1 
      Caption         =   "窗口名称"
      Height          =   255
      Left            =   2520
      TabIndex        =   3
      Top             =   120
      Visible         =   0   'False
      Width           =   735
   End
End
Attribute VB_Name = "Frmkeylog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub Command1_Click(Index As Integer)
    On Error Resume Next
    Select Case Index
        Case 0
            Cmdg.InitDir = Left(filepath, InStrRev(filepath, "\") - 1)
            Cmdg.ShowOpen
            Dim nextline As String
            If Dir(Cmdg.Filename) <> "" Then
                ListView1.ListItems.Clear
                Open Cmdg.Filename For Input As #2
                Do Until EOF(2)
                    Line Input #2, nextline
                    check_key_log nextline
                Loop
                Close #2
            End If
        Case 1
            If MsgBox("你确定吗?", vbYesNo + vbQuestion, "确定") = vbYes Then
                ListView1.ListItems.Clear
                If Dir(Cmdg.Filename) <> "" Then Kill Cmdg.Filename
            End If
    End Select
    Text2.Visible = False
    Text3.Visible = False
    Exit Sub
End Sub

Private Sub Form_Activate()
     On Error Resume Next
        Dim i As Integer
     Dim clmX As ColumnHeader   '添加 ColumnHeaders。列宽度等于控件宽度   '除以 ColumnHeader 对象的数目。
    
     ListView1.View = lvwReport '设置 View 属性为报表型。
     
     Set clmX = ListView1.ColumnHeaders.Add(, , "时间", 1050)
     Set clmX = ListView1.ColumnHeaders.Add(, , "窗口名称", 2500)
     Set clmX = ListView1.ColumnHeaders.Add(, , "记录", 5110)
End Sub


Private Sub Form_Unload(Cancel As Integer)
    Form1.SetFocus
End Sub

Private Sub ListView1_DblClick()
    Label1.Visible = False
    Label2.Visible = False
    Text2.Visible = False
    Text3.Visible = False
End Sub


Private Sub ListView1_Click()
    On Error Resume Next
    Label1.Visible = True
    Label2.Visible = True
    Text2.Visible = True
    Text3.Visible = True
    Text3.Text = ListView1.SelectedItem.SubItems(1)
    Text2.Text = ListView1.SelectedItem.SubItems(2)
End Sub

⌨️ 快捷键说明

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