INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Chiusura di applicazione dimenticata aperta o inattiva.

Chiusura di applicazione dimenticata aperta o inattiva.

(OP)
Mi sono da poco registrato e saluto tutti, ho cercato nelle FAQs di risolvere il problema della chiusura automatica dell'applicazione lasciata aperta o inattiva da un certo tempo (in rete) dall'utente, poichè devo aprire in exclusive le tabelle del DataBase per l'indicizzazione e il PACK. In merito ho preso in considerazione i seguente codice :

How do I auto release or shut application on inactivity ? by ramani
FAQ184-4467: How do I auto release or shut application on inactivity ?
Posted: 21 Nov 03 (Edited 21 Nov 03)
**********************************************************
* Author : Ramani (Subramanian.G)
* FoxAcc Software / Winners Software
* Type : Freeware with reservation to Copyrights
* Warranty : Nothing implied or explicit
***********************************************************
** How to AutoClose a form or application.
**
#IF .f. && Just to avoid explanations from being run
* 1. Add this Timer class definition at the end of your Main.Prg
*
* Timer Class to shutdown
* Set the interval as half of inactivity time
* i.e. if you want to shut in 10 minutes of inactivity
* set timer interval as (5 Min * 60 Sec * 1000 milli)
DEFINE CLASS ShutTimer AS Timer
Interval = 10 * (60*1000/2) && 10 minutes
Name = "ShutTimer1"

PROCEDURE Init
IF VARTYPE(ptLastUsed) = "U"
PUBLIC ptLastUsed
ENDIF
m.ptLastUsed = DATETIME()
ON KEY LABEL MOUSE m.ptLastUsed = DATETIME()
ENDPROC

PROCEDURE Timer
IF ( DATETIME()- m.ptLastUsed )*1000 > This.Interval * 2
* ThisForm.Release && if only form to be released
DO myShutDown && if application to be shutdown
ENDIF
ENDDEFINE
** Enddefine
**************************************************
* 2. ADD in the KeyPress Event of the form..
m.ptLastUsed = DATETIME()
**************************************************
* 3. Set the forms property KeyPreview = .t.
**************************************************
* 4. Add the following code in the Init of the form.
WITH ThisForm
.AddObject("oTimer","Timer")
ENDWITH
**************************************************
* 5. Add a myShutDown procedure to the end of Main.Prg
PROCEDURE myShutDown
CLEAR EVENTS
QUIT
**************************************************
** 6. Add the follwoing code at the beginning of your Main.PRG
ON SHUTDOWN DO myShutDown
**************************************************
#ENDIF && end of explanations
**************************************************
Non riesco ad utilizzarlo in una normale FORMS mia tipo CLIENTI o all'avvio dell'applicazione in fase di autenticazione dell'utente.
Grazie per eventuali suggerimenti o indicazioni.

RE: Chiusura di applicazione dimenticata aperta o inattiva.

bd81031
Have you taken into account a timer to cause the restart?



Hai preso in considerazione un timer per causare il riavvio?

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Chiusura di applicazione dimenticata aperta o inattiva.

Hi,

An other solution would be to make use of the procedure created by Sergey, which you can find at:
https://www.berezniker.com/content/pages/visual-fo...
Regards,
Jockey2

Dal momento che questo è un forum inglese ho rifiutato di rispondere in italiano

RE: Chiusura di applicazione dimenticata aperta o inattiva.

(OP)
E' proprio un timer che sto cercando di impostare nell'aplicazione, senza provocare danni alle tabelle aperte, ma nei seguenti casi: 1- partono con il programma, ma non danno le credenziali di accesso, 2-lasciano una finestra aperta in fase di input dati. Il codice di cui allegato funziona, per il primo punto inserendolo in menu.prg ma non quando si fermano alle credenziali di accesso, mentre per il punto 2, non riesco a farlo girare.

RE: Chiusura di applicazione dimenticata aperta o inattiva.

Hi,
Than make a condition to deal with your 1) and 2) in which case the shutdown should not be activated.
For 1) I suggest not to even open your application.
Regards,
Jockey2



Dal momento che questo è un forum inglese ho rifiutato di rispondere in italiano

RE: Chiusura di applicazione dimenticata aperta o inattiva.

(OP)
Sorry if I write in Italian, but I'm Italian, if you do not want to answer ITALIANI tell it. I do not see the issue of writing since it's easy to exchange news with the dealers today.
Greetings...

RE: Chiusura di applicazione dimenticata aperta o inattiva.

Yes, we want to answer in English, this is an English forum. Just like we want you to ask in English. You want us to do something for you, so it's only fair that we expect you to do an effort for us. We don't expect perfect English, but we want people to do their best. If you are a programmer, you are more or less forced to read English books, Help files and websites in English anyway, so English can't be completely incomprehensible to you. Please forgive me if I am wrong, but I think you should be able to make yourself understood in English also. I'm in the same boat as you, you don't expect me to ask in Norwegian, do you? smile

Please believe me, absolutely no offense meant.

Also have a look at http://www.tek-tips.com/viewthread.cfm?qid=1780285

RE: Chiusura di applicazione dimenticata aperta o inattiva.

bd81031 - I can't tell if you got your answer or not. I hope you did.

The intent of this forum is to:
1) not only help YOU find answers to your issues
2) but also to help OTHERS who may need answers to the same issue.

In addition to visually looking over the posts, those 'Others' may very likely use the SEARCH utility to find a posting and they wouldn't find your posting since their search phrase (in ENGLISH) would not match yours (not in English).

If you write out your question in another language the majority of users (MVP's and others) will NOT be able to offer replies/advice/suggestions to use since most of them do not speak that other language.

Additionally if you write out your question in another language which the majority of uses do not understand, then your post and its replies will NOT be of any use to the OTHERS.

In order for YOU to get the greatest number of applicable replies and for OTHERS to benefit from your question, you should post in the forum's primary language.
By looking at any specific part of this overall forum, you can see that it's primary language is English.

While there is no RULE against doing otherwise - next time, please post your question in English so that you can get replies/advice/suggestions from the majority of users and also so that the majority of Others may also benefit from the Posting and Replies.

And, as Tore has already said: Please believe me, absolutely no offense meant.

Good Luck,
JRB-Bldr
NOTE to Mike Lewis: That's JRB in Boulder, CO, USA (It's much simpler/quicker to write the short-hand)

RE: Chiusura di applicazione dimenticata aperta o inattiva.

(OP)
Ok, sorry is all clear, so coming back from the beginning can I cancel the question in Italian and rewrite it in English or leave it all so ? Greetings.

RE: Chiusura di applicazione dimenticata aperta o inattiva.

Hey Tore, I'd be happy for you to ask your questions in Norwegian. :)

bd81031, don't cancel this thread, I would just say, re-write your original question then in English and add it to this discussion.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Chiusura di applicazione dimenticata aperta o inattiva.

(OP)
I tried in the FAQs to fix the problem, but without a good result, so I would need to automatically close the open or inactive application (on the net) as I need to index and make the PACK to the tables. Thanks for collaboration.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close