Clarification...

What this does is watch for mouse movement or keyboard input as reported by the OS. If, after 60 seconds (with this example) no user activity (mouse, keyboard) the "lnElapsed < lnTick" is true and you can proceed as you see fit.

Mike


Mike Copeland wrote:
This is a huge issue for my application. Here's what I use...

    DECLARE INTEGER GetTickCount IN kernel32
    DECLARE SHORT GetLastInputInfo IN win32API STRING @

    Local lcBuf, lnLast, lnTick, lnTimeOut, lnElapsed
    lnTimeOut=60  && # of seconds
    lcBuf=BinToC(8,'4rs')+BinToC(0,'4rs')
    GetLastInputInfo(@lcBuf)
    lnLast=CToBin(Substr(lcBuf,5,4),'4rs')
    lnTick=GetTickCount()
    lnElapsed = lnLast+(lnTimeOut*1000)
    If lnElapsed < lnTick
            * do what you want here, they're out of time
    EndIf


Mike Copeland


Rafael Copquin wrote:
I wonder what is the best way to kick users out of an app when they have it open for ages without doing anything (the typical out-to-lunch). The user has a number of files open and does not do anything for a long time.

I want to have the system shut itself down after 5 or 10 minutes of inactivity

Suggestions please

Rafael Copquin


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to