You are on page 1of 1

How to kill inactive session from Forms

We have to use the D2KWUTIL.PLL. In the WHEN-NEW-FORM-INSTANCE trigger provide t


he following code:
declare
lwindow PLS_INTEGER;
ltimer TIMER;
begin
lwindow := get_window_property(FORMS_MDI_WINDOW,WINDOW_HANDLE);
Win_API_Session.Timeout_Start_Timer(lwindow);
ltimer := Create_Timer('TIMER1',1000,repeat);
end;
In WHEN-TIMER-EXPIRED trigger provide the following code:
begin
if upper(get_application_property(TIMER_NAME)) = 'TIMER1' then
:control.inactive_time := Win_api_session.Timeout_Get_Inactive_Time;
if : control.inactive_time > 120 then
Win_API_Session.timeout_delete_timer;
exit_form (NO_VALIDATE);
end if;
end if;
end;

You might also like