Inactivity timeout
Inactivity timeout
(OP)
Is there any way to close an application, gracefully of course, when a user has left the program open for hours on end with no activity?
I have an application on my primary server accessed through the Terminal Server, I do not want to close the terminal server session but want close the application only as they might and usually are in another program.
Clarion code or something else?
I have an application on my primary server accessed through the Terminal Server, I do not want to close the terminal server session but want close the application only as they might and usually are in another program.
Clarion code or something else?
RE: Inactivity timeout
You could try the code below OR buy vuFileTools from www.valutilities.com and use the vuIdleTime() function in that library.
CODE
MODULE('WinAPI')
GetLastInputInfo(*LASTINPUTINFO),BYTE,PASCAL,RAW
END
Where:
! data types
LASTINPUTINFO GROUP,TYPE
cbSize UNSIGNED(8) !SIZE(LASTINPUTINFO)
dwTime ULONG ! milliseconds
END
dwTime is the number of milliseconds since the last computer boot
! local data
LastInput LIKE(LASTINPUTINFO)
Hours LONG
Minutes LONG
Seconds LONG
! code
IF GetLastInputInfo(LastInput)
Hours = INT(LastInput.dwTime / 3600000)
Minutes = INT((LastInput.dwTime - (Hours * 3600000)) / 60000)
Seconds = INT((LastInput.dwTime - (Hours * 3600000) - (Minutes * 60000) ) / 1000)
?LastInputInfo{Prop:Text} = LastInput.dwTime & ' ' & Format(Hours,@n02) & ':' & FORMAT(Minutes,@n02) & ':' & FORMAT(Seconds,@n02)
END
The correct embed for this code is the TIMER event on the AppFrame window.
Regards