I borrowed this idea a long time ago from somewhere, maybe even from this forum, and made modifications to fit my needs. So it is fare to posted it here:
In the main program:
....
*do init.prg
Ltimer=createobject("ForceShutdown")
Ltimerclose=""
*WITH _SCREEN
*........
*ENDWITH
*READ EVENTS
*CLEAR ALL
*Return
*---------------------------
Define class ForceShutdown as Timer
Interval = 5000
Name = "ForceShutdown"
Procedure Timer
If file("coops.yyy")
? chr(7)
Wait window "A request to shutdown has been issued .... You have 1 minute to complete your work." timeout 10
Ltimerclose=createobject("Closeit",60000)
Endif
Endproc
Enddefine
*----------------------------------------
Define class Closeit as Timer
Interval = 10000
Name = "CloseIt"
Procedure INIT
Lparameter pInterval
release ltimer
if type("pInterval")="N"
this.Interval=pInterval
endif
endproc
Procedure Timer
do quit
Endproc
Enddefine
>Yuri could you send the sample to my email aafzal_khan@hotmail.com
>
>Thanks
>
>
>>This is what could help you.
>>Sometimes I need to make updates to userinterface.EXE during the business hours and force users to close particular applications. When I want to do it, I create a flag file with name related to application to be closed. Each EXE contains a timer that check for the flag file and if found gives user a warning, one minute to complete the job and then quit the application.
>>If interested I can send example to you.
>>
>>>hi!
>>>
>>>is it possible to kill a running process with foxpro?
>>>
>>>if the user makes an update to the exe it must be closed. some users forget closing the exe though the update-prog ask if the main-program is closed on all workstations.
>>>
>>>i'm thinking of a command similar like in linux -> kill ...
>>>
>>>TIA
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only