Private Sub Form_Unload(Cancel As Integer)
Dim MsgReturn As Integer
MsgReturn = MsgBox("确实要退出子程序吗?", vbYesNo + vbQuestion, "教学系统")
If MsgReturn = 6 Then
On Error Resume Next
Dim myfile As String
myfile = Dir(FilePath & "*.gif")
Do While myfile <> ""
Kill FilePath & myfile
myfile = Dir
Loop
mdb.Close
Call CloseCKC
End '*******************这里终止了全部进程
Else
Cancel = 1
Call SetLeftPicture
End If
还是没发现异样代码
代码太长了,贴出几个关键地方:烦请指点,谢谢
主窗体:://CloseCKC某个指定关闭输入法
Private Sub Form_Unload(Cancel As Integer)
Dim MsgReturn As Integer
MsgReturn = MsgBox("确实要退出子程序吗?", vbYesNo + vbQuestion, "教学系统")
If MsgReturn = 6 Then
On Error Resume Next
Dim myfile As String
myfile = Dir(FilePath & "*.gif")
Do While myfile <> ""
Kill FilePath & myfile
myfile = Dir
Loop
mdb.Close
Call CloseCKC
End
Else
Cancel = 1
Call SetLeftPicture
End If
End Sub
子窗体://CloseCKC某个指定关闭输入法,SetWindowLong将默认的窗体程序还原
Private Sub Form_Unload(Cancel As Integer)
If WordNum <> 0 And CmdStart.Enabled = False Then
If MsgBox("È·ÐÅÒªÍ˳ö±¾Á·Ï°£¿", vbYesNo + vbQuestion, TrainFlag) = vbNo Then
Cancel = 1
If Command3.Caption = "ÔÝÍ£(&P)" Then Text1(TextIndex).SetFocus
Else
rs.Close
Call CloseCKC
Dim i As Integer
For i = 0 To 44
SetWindowLong Text1(i).hwnd, GWL_WNDPROC, prevWndprocT(i)
Next
End If
End If