local iTime as integer, iLast as integer >local plii as string, cLast as string > >declare integer GetTickCount in kernel32 >declare short GetLastInputInfo in win32api string @ plii > >? > >for n = 1 to 2 > > iTime = GetTickCount() > plii = chr(8) + replic( chr(0), 7 ) > cLast = GetLastInputInfo( @plii ) > iLast = ( asc( substr( plii, 8, 1 ) ) * 16777216 ) + ; > ( asc( substr( plii, 7, 1 ) ) * 65536 ) + ; > ( asc( substr( plii, 6, 1 ) ) * 256 ) + ; > ( asc( substr( plii, 5, 1 ) ) ) > > ?? ( iTime - iLast ) / 60000, ' ' > > if n=2 > exit > endif > > for k = 1 to 60 > inkey(1) > ?? str( mod( k, 10), 1 ) > next >nextPeter,
* define class ... * ... Add Object FlagChecker As Timer With Interval=30000 Procedure FlagChecker.Timer Local lcShutDown,lnSecondsLeft With This.Parent If .IsShutDownFlagged() If !.lStartCountDown .nCountdown = Int(.GetShutdownTime()) .nShutDownType = .GetShutDownType() .lStartCountDown = .T. && Enable CountDown counter This.Interval = 5000 Else .nCountdown = Int(.nCountdown - (This.Interval/1000)) If .nCountdown <= 0 This.Enabled = .F. .ShutDownApp() Endif Endif If !.lNotified * Prepare message TEXT to lcShutdown textmerge noshow Application will shutdown automatically in <<.nCountDown>> seconds. Please complete your work and shutdown the application. ENDTEXT .lNotified = ; ( Messagebox(m.lcShutDown,0+64,"Application Shutdown",This.Interval) = 1 ) && Show Message Endif Else If .lStartCountDown && If a countdown was in progress .lStartCountDown = .F. This.Interval = 30000 * Show cancel message Messagebox("Application shutdown is cancelled."+chr(13)+; "You may continue to work.",0+64,; "Application Shutdown",This.Interval) Endif Endif Endwith Endproc * other procsCetin