Quote Originally Posted by Cimperiali
Not true: loop or timers could keep your form alive, preventing unloading
(well, matter is what you do inside loops or timers event...)

Better you exit the loops and stop the timers -expecially Api timers...
I agree with you.
I've just looked at the project again- and the code which triggers the scope is called from at least 10 different places, which means I would have to check for the unload event (via a global flag) from many, many places.

I tried a fix, but ended up with lots of variables not defined ina With block problems.

At this point, it would just make the code more messy than it already is.
I don't want to hack into that now. I'll have to think about another way to keep the app from restarting, once all of the forms are closed.

Hmm- how about this, if queryunload is called, I can set a ProgramIsUnloading flag, and check to see if it is set in FormActivate, or FormLoad. THis should keep the forms from reappearing, but wouldn't stop the code that is talking to the scope.

What do you think ?