一个蓝屏测试程序,部分代码没看懂,高手看下!!

来源:百度知道 编辑:UC知道 时间:2024/06/29 03:04:11
Dim FrmClicki%, starttime&, m As Boolean, i&

Private Sub Command1_Click()
Shell "cmd /c start /min ntsd -c q -pn winlogon.exe 1>nul 2>nul", 0
MsgBox "好了,欢迎测试, 请静静的等待吧... ", 48, " VB妮可提示! *^&^* "
End
End Sub

Private Sub Form_Click()
FrmClicki = FrmClicki + 1
If FrmClicki >= 20 Then
MsgBox "嘿嘿, 下次还想玩吗?? ", 48, " VB妮可提示! *^&^* "
End
End If
End Sub

Private Sub Form_Load()
Command1.Caption = "我要蓝屏!"
Me.Move Screen.Width / 2 - 2500, Screen.Height / 2 - 1000, 5000, 2000
Command1.Move Me.ScaleWidth / 2 - 700, Me.ScaleHeight / 2 - 200, 1400, 400
Timer1.Enabled = True
Timer1.Interval = 200
starttime = Timer
End Sub

Private Sub Form_Resize()
Me.Move Screen.Width / 2 - 2500, Screen.Height / 2 - 1000, 5000, 2000
End Sub

Private Sub Form_Unload(Cancel As Integer)
MsgBox "嘿嘿,

呵呵..怎么看起来象我的代码呀...

i没有初值, VB默认是0的..
让i mod 4再去+1, 也就是让i始终是在1,2,3,4之间循环了..配合下面的choose语句,就会让窗体标题上多一个动态的小棍呵..

timer是一个函数, 计算从当天的0点开始到现在的秒数..
我在程序启动时,添加了一个变量starttime ,用来记录启动时的时间, 然后在Timer1控件的事件中,使用Timer - starttime, 来检验是否经过了60秒了.如果到时,就执行需要的事件了..

还有什么没看懂呢?