>I have a little exe which needs to monitor a certain resource. To make sure it's always on, I run it via task scheduler (so far so good, that works), however just in case it may get stuck, I want to recycle it. So I've set the task scheduler to stop the existing instance if it's already running. That doesn't work.
>
>The exe has practically no GUI, save for a toolbar with an exit button, and it sits in infinite Read Events state. The exit button works fine - deletes the objects, executes a Clear Events and the app exits gracefully.
>
>However, the task scheduler doesn't kill it. I've set it to run a new instance every 5 minutes (just for testing) and sure enough, after half an hour I have 5-6 of them stacked up. Now I guess I should bindevent() to something, just don't know what. I've tried _screen's QueryUnload() - doesn't fire (not even when I click the closebox manually). Tried _screeen.hwnd with wm_close, wm_quit and wm_destroy, doesn't fire.
Fix your EXE so it doesn't get stuck ;) Only half joking, if you can do that a lot of cruft goes away.
Otherwise maybe something like
http://www.sevenforums.com/general-discussion/224903-how-close-exit-some-program-using-task-scheduler-windows-7-a.html ?
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up