Auto logout of powerbuilder application

murugaiah used Ask the Experts™

I am working in powerbuilder 5.0.04. I want to auto logout the powerbuilder application when the not use this application for xx minutes.

For example window's screen saver will be activited if no movement is mouse or in keyboard.
Like that I want to logout if the particular pb application not used for xx minutes, it should automatically logout.

Can you please suggest how I can achive this feature.

Thank in advance


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

You start a timer in the open event of the application with the function Idle(n) ... where n is the number of seconds of user inactivity allowed before PowerBuilder triggers an Application Idle event.

In the idle event of the application you insert HALT CLOSE command that terminates the application
You must use the function "Idle" to set the number of seconds of user inactivity.
Later, you must codify the event Idle for application object.
See the help of "Idle" keyword. There is examples ...

Before two years I read somewhere there exist a function for screen saver, allow to logout from application and start ScreeenSaver and you yre again in application.

I think you want to do so but not to HALT OR CLOSE the application.

I am trying to remember and trying to find this function, Let you know soon.

Please let me know you are searching for the same what I wrote above, but you don't want to HALT the application that user needs again ti start the application.

As was mentioned earlier use the following code.

If Idle(300)= 1 then
end if

Please note that 300 is in seconds. So you can apply any length of time you want there. In the close statement you can use "this" if you are in the window where the script is applied. If not use "parent" or the name of the main window instead of "this".

I will advice that you apply this script in the main window of your program.

Please note that you can use only idle(XXX). XXX being the idle time in seconds.
Put it in your open event of your main window scripts.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial