FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to check program is not use for specific time?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
How to check program is not use for specific time?
Posted: 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 2304 / 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)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to check program is not use for specific time?
Posted: Sat Dec 19, 2009 06: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to check program is not use for specific time?
Posted: Sat Dec 19, 2009 06: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 2304 / 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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to check program is not use for specific time?
Posted: 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
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: How to check program is not use for specific time?
Posted: Sun Dec 20, 2009 09: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
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to check program is not use for specific time?
Posted: Sun Dec 20, 2009 04: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 2304 / 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)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: How to check program is not use for specific time?
Posted: Sun Dec 20, 2009 05: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

Continue the discussion