khizerharoon
Programmer
I need to check whether the app is being closed by the system or by the user itself.
if the user is shutting down the windows, he would cause the application to abort normally which I want to avoid. Basically i wanna avoid the user to NOT to press the "End Task" button.
I can manage to stop the shutdown by the following API
Public Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long
what i wanna know is whether I can s judge my app is being closed by the system or by the user. if it is system i would call abort....but if it is the user then i can easily unload the form and save my settings etc.
if the user is shutting down the windows, he would cause the application to abort normally which I want to avoid. Basically i wanna avoid the user to NOT to press the "End Task" button.
I can manage to stop the shutdown by the following API
Public Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long
what i wanna know is whether I can s judge my app is being closed by the system or by the user. if it is system i would call abort....but if it is the user then i can easily unload the form and save my settings etc.