CLOSE APPLICATION AFTER A PERIOD OF NO USE
CLOSE APPLICATION AFTER A PERIOD OF NO USE
(OP)
Dear all
any body have an idea how to close application after a certain period of time that user didnt do any action in that period.
any body have an idea how to close application after a certain period of time that user didnt do any action in that period.
RE: CLOSE APPLICATION AFTER A PERIOD OF NO USE
Read on the IDLE() command in the Help. The other way is to use the windows API.
Regards
RE: CLOSE APPLICATION AFTER A PERIOD OF NO USE
I tried to use IDLE() command before writing this post but it didnt work with me (may be I didnt apply it will), so I did a routine using Timer and it worked fine.
Thank you again
RE: CLOSE APPLICATION AFTER A PERIOD OF NO USE
With TIMER(), how do you determine that no keyboard & mouse activity has not taken place?
Regards
RE: CLOSE APPLICATION AFTER A PERIOD OF NO USE
The Windows API approach ::
Inside the Global MAP:
MODULE('WinAPI')
sjGetLastInputInfo(*LastInputInfo),BYTE,PASCAL,RAW,NAME('GetLastInputInfo')
sjGetTickCount(),LONG,PASCAL,NAME('GetTickCount')
END
Data Section of FRAME:
LastUserInput LIKE(LastInputInfo)
EVENT:Timer of FRAME:
IF sjGetLastInputInfo(LastUserInput)
Ticks# = sjGetTickCount()
LastUserInput.dwTime = Ticks# - LastUserInput.dwTime
LUI_Hrs# = INT(LastUserInput.dwTime / 3600000)
LUI_Min# = INT((LastUserInput.dwTime - (LUI_Hrs# * 3600000)) / 60000)
LUI_Sec# = INT((LastUserInput.dwTime - (LUI_Hrs# * 3600000) - (LUI_Min# * 60000) ) / 1000)
END
The LUI_Hrs#, LUI_Min# & LUI_Sec# gives you the No User Activity time.
Regards