chpicker
Programmer
- Apr 10, 2001
- 1,316
I created a program that runs in the background. It runs on a timer to watch for new files in a given folder and act upon them. I used the FoxTray program that I had found a couple of years ago (I don't remember where offhand) to give me an icon in the system tray so I can shut it down when I need to.
All of my shutdown code is in the CLOSEAPP.PRG file. This is all it does:
My main program executes "ON SHUTDOWN DO closeapp" just before the READ EVENTS command.
The only menu command attached to the FoxTray icon is "Shut Down" which executes "DO CLOSEAPP".
Everything appears to work fine. If I select "Shut Down" from the menu, the program closes almost instantly. If I bring up the task list immediately afterward, it's no longer listed.
Here's the odd part: if I try to shut down Windows, all of my programs, including this one, shut down just fine...but Windows doesn't! I have to shut down Windows a second time to get it to do so.
I am using VFP 7.0 with SP1. The computer is running Win98SE. This problem is infinitely repeatable. Every time I select "Shut Down" (or Restart, or Log Off) it shuts down my programs, but goes right back to the desktop...ONLY if this one program is running! If I re-launch the program and try to shut down, it again just kills the program and goes back to the desktop. Is VFP somehow telling Windows to abort the shutdown even though it exits properly? Is there anything I can do to fix this?
Ian
All of my shutdown code is in the CLOSEAPP.PRG file. This is all it does:
Code:
[COLOR=blue]ON SHUTDOWN[/color] [COLOR=green]&& Disable further shutdown attempts[/color]
[COLOR=blue]CLEAR EVENTS[/color]
The only menu command attached to the FoxTray icon is "Shut Down" which executes "DO CLOSEAPP".
Everything appears to work fine. If I select "Shut Down" from the menu, the program closes almost instantly. If I bring up the task list immediately afterward, it's no longer listed.
Here's the odd part: if I try to shut down Windows, all of my programs, including this one, shut down just fine...but Windows doesn't! I have to shut down Windows a second time to get it to do so.
I am using VFP 7.0 with SP1. The computer is running Win98SE. This problem is infinitely repeatable. Every time I select "Shut Down" (or Restart, or Log Off) it shuts down my programs, but goes right back to the desktop...ONLY if this one program is running! If I re-launch the program and try to shut down, it again just kills the program and goes back to the desktop. Is VFP somehow telling Windows to abort the shutdown even though it exits properly? Is there anything I can do to fix this?
Ian