Home » Developer & Programmer » Forms » D2KWUTIL.PLL make form slow to respond
D2KWUTIL.PLL make form slow to respond [message #288989] Wed, 19 December 2007 03:47 Go to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

i am using d2kwutill.pll in forms6i
-----
* In your WHEN-NEW-FORM-INSTANCE Code */
declare 
  hWnd PLS_INTEGER := get_window_property(FORMS_MDI_WINDOW, WINDOW_HANDLE);
  CheckTimeout TIMER;
begin
  -- Start the process in the DLL that hooks into the Keyboard and mouse
  WIN_API_SESSION.TIMEOUT_START_TIMER(hWnd);

  -- Start the Forms Timer that will be used to check the idle time
  CheckTimeout := CREATE_TIMER('TIMEOUT', 1, REPEAT);
end;

--------
/* In your WHEN-TIMER-EXPIRED Code */
if get_application_property(TIMER_NAME) = 'TIMEOUT' then 
  if WIN_API_SESSION.TIMEOUT_GET_INACTIVE_TIME > 60 then
    -- boot the user off if been idle for 1 min or more
       exit_form;
  end if;
end if;

--------
/* In Your Exit or POST-FORM code */
WIN_API_SESSION.TIMEOUT_DELETE_TIMER;

-------
basically i am only using WIN_API_SESSION of that library to handle session in my form.
but it making form to not responding.

Whats the issue?? can any one tell.Or am i doing it right way.(Or how can i use session in my application)

[Updated on: Wed, 19 December 2007 05:05]

Report message to a moderator

Re: D2KWUTIL.PLL make form slow to respond [message #289146 is a reply to message #288989] Wed, 19 December 2007 19:34 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Your create timer is performing every millisecond. Change the '1' to '1000' or '10000' (ten seconds) and see how that goes.

David
Re: D2KWUTIL.PLL make form slow to respond [message #289613 is a reply to message #289146] Mon, 24 December 2007 05:25 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

declare 
  hWnd PLS_INTEGER := get_window_property(FORMS_MDI_WINDOW, WINDOW_HANDLE);
  CheckTimeout TIMER;
  one_minute NUMBER(5) := 60000;
begin
  -- Start the process in the DLL that hooks into the Keyboard and mouse
  WIN_API_SESSION.TIMEOUT_START_TIMER(hWnd);

  -- Start the Forms Timer that will be used to check the idle time
  CheckTimeout := CREATE_TIMER('TIMEOUT', one_minute, NO_REPEAT);
end;


ok now i changed timer.now form runs fine.but it did not exit after
expiration.WIN_API_SESSION not working.

[Updated on: Mon, 24 December 2007 05:26]

Report message to a moderator

Re: D2KWUTIL.PLL make form slow to respond [message #291362 is a reply to message #289613] Fri, 04 January 2008 00:20 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post code containing 'expiration.WIN_API_SESSION'.

Have you tried using 'exit_form'?

David
Re: D2KWUTIL.PLL make form slow to respond [message #291803 is a reply to message #291362] Sun, 06 January 2008 23:44 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

this is code used in when_timer_expired.
for session expiration.
its working also fine but only once when session expires a log on form appears and user will have to enter password again.
but after that session expiration does not work.
if get_application_property(TIMER_NAME) = 'TIMEOUT' then 
  if WIN_API_SESSION.TIMEOUT_GET_INACTIVE_TIME > 30 then
  	message('session expires');
  	message('session expires');
    -- boot the user off if been idle for 1 min or more
       --exit_form(no_validate);
       clear_message;
       open_form('c:/sams/lock', activate, session);
  end if;
end if;
Re: D2KWUTIL.PLL make form slow to respond [message #292406 is a reply to message #291803] Tue, 08 January 2008 21:39 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I would suggest using 'call_form' so that after the users logs back on they return to THIS routine.

David
Re: D2KWUTIL.PLL make form slow to respond [message #294508 is a reply to message #288989] Thu, 17 January 2008 18:13 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have a look at Metalink's "How To Avoid The Error Message FRM-92101 When Form Session Times Out" Note:375585.1

David
Re: D2KWUTIL.PLL make form slow to respond [message #294536 is a reply to message #294508] Thu, 17 January 2008 23:31 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

sorry.I do not have metalink login so i can`t check this.

well i have another query.

session time out documentation of d2kwutil says.
TIMEOUT_START_TIMER

Establishes the hooks. you must be careful to only call this function ONCE in your whole run form session.
So make this call in the When-New-Form-Instance trigger of your first form.


But if i open another form from menu in same session i think i have to start timer again in
When_New_Form_Instance

of new form.

Am I Right??

[Updated on: Thu, 17 January 2008 23:32]

Report message to a moderator

Re: D2KWUTIL.PLL make form slow to respond [message #294916 is a reply to message #294536] Sun, 20 January 2008 19:48 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The documentation actually says "Do not call WIN_API_SESSION.TIMEOUT_START_TIMER for a second time in the runtime session without calling DELETE_TIMER first. If you do you may get an access violation."

So, test to see if the timer exists, if it does exist then delete it. Then create the new timer. You will find sample code under 'find_timer' in the reference manual.

David
D2KWUTIL.PLL USING IN ORACLE FORMS 10G [message #683073 is a reply to message #289146] Tue, 01 December 2020 01:03 Go to previous messageGo to next message
nihadsaleh
Messages: 1
Registered: December 2015
Location: Jordan
Junior Member

hi
i want to use D2KWUTIL IN ORACLE FORMS 10G, FOR IDEL TIME AND I WRITE THE FOLLOWING CODE IN WHEN_NEW_FORM_INSTANCE
declare
timer_id Timer;
v_win pls_integer;
check_time_out Timer;
begin
v_win :=get_window_property(forms_mdi_window,window_handle);
Win_Api_Session.TimeOut_Start_timer(v_win);
check_time_out := create_timer('Timeout',1000,repeat);
exception
when others then
message(sqlerrm);
end ;

BUT THIS STATMENT NOT EXECUTED [ Win_Api_Session.TimeOut_Start_timer(v_win); ]
ERORR
CAN ANY ONE HELP ME TO WRITE THIS CODE IN FORMS 10G TO BE EXECUTED SUCCESSFULLY .
Re: D2KWUTIL.PLL USING IN ORACLE FORMS 10G [message #683074 is a reply to message #683073] Tue, 01 December 2020 01:07 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.

Previous Topic: Disable Ctrl+C in forms12c runtime
Next Topic: Show Records between two dates in Form 6i
Goto Forum:
  


Current Time: Thu Mar 28 06:30:00 CDT 2024