Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time elapsed
Message
De
15/08/2001 00:06:19
 
 
À
13/08/2001 07:35:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00542912
Message ID:
00543883
Vues:
20
>I have a form where want to count the elapsed time from last movement of mouse or last key press and then release the form or activate a messagebox if time have a value gived by me.


You can create a timer to do that, somethign like this:
PUBLIC oT
oT = CREATEOBJECT('mytimer')

DEFINE CLASS mytimer AS timer
	nRow = 0
	nCol = 0
	nLastKey = 0
	Interval = 5000

	PROCEDURE Init
		this.SetValues()
	ENDPROC 

	PROCEDURE timer
		IF this.nRow = MROW() and this.nCol = MCOL() and ;
			this.nLastKey = LASTKEY()
			MESSAGEBOX('No movement has been detected.')
		ELSE 
			this.SetValues()
		ENDIF 
	ENDPROC 

	PROCEDURE SetValues
		this.nRow = MROW()
		this.nCol = MCOL()
		this.nLastKey = LASTKEY()
	ENDPROC 
ENDDEFINE
If you leave your mouse and keyboard in the same state for 5 seconds (the Interval property) you get a messagebox() saying no movement has been made.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform