📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function GetTickCount Lib "kernel32" () As Long
Dim fso As Object
Public time1 As Integer '考试剩余时间
Public sec As Integer '考试剩余秒种
Public min As Integer '考试剩余分钟
Public xm As String '考生姓名
Public xh As String '考生学号
Public bj As String '考生班级
Public zkzh As String '考生的准考证号
Public sum As Integer '考试得分总和
Public ksdo As Integer '考试是否已生成随机试卷 0,1
Public Const kspath = "d:"
'Public date1 As SYSTEMTIME
Public Sub save()
Dim X As Object
Dim o As Object
Dim winHwnd As Long
Dim RetVal As Long
Const WM_CLOSE = &H10
Set fso = CreateObject("Scripting.FileSystemObject")
Set myfile = fso.CreateTextFile(App.Path & "\testfile.txt", True)
myfile.writeline (zkzh)
myfile.writeline (bj)
myfile.writeline (xm)
myfile.writeline (time1)
myfile.writeline (sum)
myfile.writeline (ksdo)
myfile.Close
Do While FindWindow("OpusApp", vbNullString) <> 0
SendMessage FindWindow("OpusApp", vbNullString), WM_CLOSE, ByVal 0, 0
Loop
If FindWindow(vbNullString, "Microsoft Frontpage") <> 0 Then
SendMessage FindWindow(vbNullString, "Microsoft Frontpage"), WM_CLOSE, ByVal 0, 0
End If
Do While FindWindow("XLMain", vbNullString) <> 0
SendMessage FindWindow("XLMain", vbNullString), WM_CLOSE, ByVal 0, 0
Loop
On Error GoTo X
Do
Set o = GetObject(, "PowerPoint.Application")
o.Quit
Set o = Nothing
Loop
X:
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -