Controla el tiempo inactivo de tu soft
Para aquellos usuarios descuidados y para proteger los datos del mismo
Con un poco de creatividad puedes hacer que solicite la clave de usuario y poner un Form transparente, etc.....
Mas abajo dejo un ejemplo de uso sencillo....
EL CODIGO EN UN MODULO CLASE
Option Compare Database
'************************************************************
'& &*
'& : || : &*
'& || &*
'& || &*
'& || &*
'& . - || - . &*
'& ( || ) &*
'& ) ( || ) ( &*
'& / || \ &*
'& ( || ) &*
'& ` ` &*
'& ` ____ ' &*
'& &*
'& Jefferson Jimenez (JJJT) &*
'& Cabimas - Venezuela &*
'& Noviembre - 2011 &*
'& &*
'& &*
'& &*
'& &*
'& &*
'************************************************************
'Declaramos al API que me detecta la inactividad
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function GetLastInputInfo Lib "user32" (plii As Any) As Long
Private Type LASTINPUTINFO
cbSize As Long
dwTime As Long
End Type
Private TiempoInact As Long 'El tiempo de Inactividad en Segundos
Private WithEvents frm As Form
'Al Cargar
Function JJJT_Inactivo(frmActivo As Form, QueTiempo As Long)
Set frm = frmActivo 'Establezco el Form
TiempoInact = QueTiempo
With frm
.TimerInterval = 500 'le paso el tiempo
.OnTimer = "[Event Procedure]"
End With
End Function
'Creo el evento Timer
Private Sub frm_Timer()
Dim TiempoOut As Long
Dim lii As LASTINPUTINFO
lii.cbSize = Len(lii)
Call GetLastInputInfo(lii)
TiempoOut = FormatNumber((GetTickCount() - lii.dwTime) / 1000, 0)
If CInt(TiempoOut) >= TiempoInact Then
MsgBox "Inactividad prolongada"
TiempoOut = 0
End If
End Sub
'********************************************************************************************
'Para Usarlo :
'Crea un Modulo Clase, Pega este Codigo y dale por Nombre Cls_Inactivo
'En el Formulario que elijas, declara este Modulo Clase
'
' Option Compare Database
' Private MiFrm As New Cls_Inactivo
'
'
' Private Sub Form_Load()
' MiFrm.JJJT_Inactivo Me,5
' End Sub
'********************************************************************************************