static ptime As Date = Date.Now
static leave As Boolean = False
If Windows.Forms.Form.ActiveForm Is Nothing AndAlso leave = False Then
ptime = Date.Now
leave = True
ElseIf Windows.Forms.Form.ActiveForm IsNot Nothing Then
If leave = True Then
leave = False
Dim sp As TimeSpan = Date.Now - cdate(ptime)
If sp.TotalSeconds > 10 Then
If Forms("登陆窗口").Opened = False Then
Forms("登陆窗口").show
End If
End If
End If
If LastInputTickCount > 10000 Then
If Forms("登陆窗口").Opened = False Then
Forms("登陆窗口").show
End If
End If
End If