Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CloseButton and ExitProcess
Message
De
20/04/2011 12:14:54
 
 
À
20/04/2011 08:45:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01507897
Message ID:
01507934
Vues:
54
>I use ExitProcess() to be able to test for an 'errorlevel' in the batchfile. As it is now, I can manage that it returns 2 if the app is quit via ESC or a Quit-button. It will produce no value (giving errorlevel 0) if there's an oncontrolled break (e.g. a crash) and in all other conditions a 1. This 1 is produced if the Windows Task Manager ends the app, but it is also produced if the CloseButton (see property Closeable) is chosen.
>
>
*	Visual FoxPro doesn't natively provide a method to return an error level 
>*	to the operating system when terminating. It can be done using a call to the 
>*	Win32 API call ExitProcess(). VFP will immediately terminate and will return 
>*	the value of the parameter as the error level.
>DECLARE ExitProcess in Win32API INTEGER ExitCode
>*
>*	0 = Uncontrolled break, for example a crash.
>*	1 = Quit via [x] in upperright corner or via Windows Task Manager.
>*	2 = Quit via Quit-button or via ESC.
>ExitProcess( iif( m.glUserQuit, 2, 1 ) )
>
>Who knows of a way to see that the CloseButton was pressed?

Goedemiddag,

I believe, if you are looking for the Close Button in the upper richt corner : this will instantiate the QueryUnload event, and to my knowledge the only one except in default situation.

Hope this will give you the solution.

Groet,

Koen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform