Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible to Detect Windows Logoff?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01589576
Message ID:
01589603
Vues:
33
>>>>>I have an application that indicates whether a user is logged into it, and if a record is being modified. When the uses closes the application, it updates the online status. I discovered that if the user logs out of Windows, the VFP application is forced to close, and the online status remains unchanged. Is there a way for VFP to detect whether the user is logging out of Windows, or shutting down, so that it can perform its cleanup?
>>>>>
>>>>while you can hook windows events, it may be safer to keep a lock on a shared table which is automatically freed if the app closes/crashes or the machine is disconnected.
>>>>
>>>>thomas
>>>
>>>Thank you, Thomas. Yes, the lock already releases when the application closes, however a dashboard that shows user status is not being updated.
>>>
>>not knowing your exact use case my gut twitches for coding to such lock releases, as power outings will close down before any win events are sent - unless a reliable UPS on any machine running your app is guaranteed. And even then liquids can stop machiines ;-)
>
>My focus is dealing with routine logoffs and shutdowns versus failures. However, the need for coding could be eliminated if the users closed the application first, as they are told.

Guess I get the drift, but IMO you can only expect to rely on part of the events being fired/hookable. At least you could log attempts to clse down the app which AFAIK will be firing either on Taskmanager process shutdown, WINAPI, shell event or windows close down. Rely on the lock and wanted, explained and unexplained releases.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform