INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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.
 

RE: CLOSE APPLICATION AFTER A PERIOD OF NO USE

Hi!

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

(OP)
Thank you Shanker,

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

Hi!

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

Hi!

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close