Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
From one VFP application closing all other VFP app runni
Message
De
21/04/2003 10:22:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00778539
Message ID:
00779782
Vues:
22
Thanks fo the reply.

Your solution is very good but because we were having lot of different application we were hoping to find a way to close app without having to make change in every application making them checking for a flag file. But it's not easy to do and maybe we will have to. But I think your solution is the best way to do the job, the API we try to do the job work only once in a while.

Thanks

Michel

>A program I worked on a while back did this when an exclusive type job was requested. All we did was put a file in a shared directory and the other programs looked for that file at a specified interval. If the file was there, the local application shut down if nothing was open, or asked the user to save and shut down. Since we used a lock on a security table, we also knew what workstations were still open.
>
>The system where the main exclusive job was open just looped every 10 seconds or so and looked in the security table for locks on the records. Once the locks were all released the application started processing.
>
>The other systems would not log in until the file was gone - which the job server removed when it was finished processing.
>
>HTH
>
>>Hi
>>
>>Not an easy question today.
>>
>>We open a VFP application and this application is making some critical update so we need to close all other vpf app that are open (sometime three to five different vfp app).
>>
>>- first we want to loop to open application
>>- for each application, close this application
>>
>>- if the application ask question about saving data and don't close we must know that the application didn't close (returning a flag if this work or not)
>>
>>Finally we will advise user if one or more application didn't close and wait until he will close by himself those application.
>>
>>Under my name I will put a sample of the code we try but sometime this work and sometime not. Each time we are having different result
>>
>>Any idea
>>
>>Thanks
>>
>>Michel
>>
>>* sample code (only a part)***************************
>>
>> If tlClose
>> * nThreadID is the ThreadID member passed back through a PROCESSINFO structure
>> #DEFINE WM_QUIT 0x12
>> = PostThreadMessage(nWindowThreadID, WM_QUIT,0,0) > 0
>> lnFerme = .F.
>> ltest = ""
>> set step on
>> Do While lnFerme = .F.
>> ll=GetExitCodeThread(nWindowThreadID,0)
>> EndDo
>> Read Timeout 0.5
>> EndIf
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform