功能:如果在指定时间内,用户没有进行鼠标和键盘的操作,则认定空闲,从而进行响应操作
Public Class frmSetting
Implements IMessageFilter
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Application.AddMessageFilter(Me)
End Sub
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements System.Windows.Forms.IMessageFilter.PreFilterMessage
'==Retrigger timer on keyboard and mouse messages
If (m.Msg >= &H100 And m.Msg <= &H109) Or (m.Msg >= &H201 And m.Msg <= &H209) Then
'Do your action
En