How to check program is not use for specific time?

How to check program is not use for specific time?

Postby dutch » Sat Dec 19, 2009 11:55 am

I would like to close program or log off for specific time if the user does not use.

I guess the oTimer() will be used but how can I do that?

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to check program is not use for specific time?

Postby James Bott » Sat Dec 19, 2009 6:31 pm

The key is that we need to detect keystrokes and mouse moves and clicks. You would need to reset the timer after each keystroke and mouse move or click. I don't know how to do this.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to check program is not use for specific time?

Postby dutch » Sat Dec 19, 2009 6:52 pm

Dear James,

Thanks for your idea. I have another point, if can we detect screen saver is lActive? If so, we can check from that point.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to check program is not use for specific time?

Postby Antonio Linares » Sat Dec 19, 2009 10:47 pm

Dutch,

You can modify this screensaver example in FWH:
viewtopic.php?p=88848#p88848
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to check program is not use for specific time?

Postby Jack » Sun Dec 20, 2009 9:59 am

I have the same question and solved it this way :

EACH TIME I ENTER IN A MENU,A BROWSE , A DIALOG , I CALL the CheckT procedure with 1 as parameteers, it reset the counter to 1 CheckT(1)





DEFINE WINDOW oWnd FROM 0,0 TO 29,78
MENU BuildMenu()
SET MESSAGE OF oWnd ;
TO "Timer ;
CENTERED DATE KEYBOARD

DEFINE TIMER oTmr INTERVAL 10000 ACTION CheckT() OF oWnd
ACTIVATE TIMER oTmr

ACTIVATE WINDOW oWnd MAXIMIZED
*


* ===
procedure CheckT(pr)
LOCAL hWnd,wjacfo,vdxx
static cteur:=1
if pr=NIL
cteur:=cteur+1
oWnd:SetMsg("Value TimeOut :"+str(cteur,10)+" ")
else
cteur:=pr && reset
endif
*
if cteur > 300 && This will stop the application
cteur:=1
oTmr:end()
close databases
set resources to
cteur:=1
*
oWnd:end()
quit
endif
*
RETURN
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: How to check program is not use for specific time?

Postby dutch » Sun Dec 20, 2009 4:33 pm

I have more than 100 dialogs. How does it works? It is not possible to put timer in every dialog.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to check program is not use for specific time?

Postby Daniel Garcia-Gil » Sun Dec 20, 2009 5:01 pm

Hello Dutch...

you can modify window class and implement James idea in window class, use a CLASSDATA to keystrokes and use one main timer, this way you dont need modify your code
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests