Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One form application
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00299291
Message ID:
00299772
Views:
18
>>Force of habit, Bruce - someone might pop off the Windows Shutdown dialog, or try to terminate the application using Task Manager, both of which result in Windows Mesages that would try to get the app to kill itself. I'm sure all your end-users are careful to exit all apps before installing something that requests a reboot...< BEG >
>
>Ah, I see what you're getting at. Normally (not that this often happens), in my apps, you will get a "Cannot Quit vfp" message if that type of abortive exit occurs, and the app pops up, so the user must close it. And deal with any "Unsaved data" type messages, also. The other ON SHUTDOWN proc commands are not needed, they still work as normal within a top-level, since it must still be closed by user.
>

You need at least the CLEAR EVENTS so that the QUIT will be respected; the others help deal with possible objects floating around that should be released before shutdown. Dangling object references can prevent the QUIT from working, too.

>But you've got me thinking about it now - I guess the ideal situation would be to not use the ON SHUTDOWN for anything except QUIT, but to check for unsaved data first, and get rid of that "Cannot Quit vfp" message.
>

The problem here is that there things outside of the app that can request a shutdown (receipt of a WM_QUIT message, for example) that migth not cooperate and make sure that the world was ready to shut down, or have a user who'll respond in a timely fashion. I have the "pleasure" of having people go home at night and forget to exit from an app or three on their system...can cause real havoc if I've scheduled the system to push out something on an automatic basis that expects to be able to reboot, like some AV updates.

>A little project to work on, to get the right sequence of events...
>
>Here's a puzzle for you, though - I put ON SHUTDOWN QUIT in a TL. I run app, leave it open, and try to shutdown/logoff machine. Guess what? Nothing happens, except the app closing. The shutdown/logoff get aborted. Why would that be?

Logoff under Win9x in particular aborts because the ExitWindowEx() call won't by default use the FORCE flag; it sends a message to each open process requesting a shutdown, and if the application doesn't respond within a period of time, the logoff action is aborted. You'll see messages pop at times if Outlook is running and you request a logoff.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform