Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How QUIT when messagebox is on screen?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00162432
Message ID:
00162514
Views:
17
>>>Have a c++ timer running in the background. The cpptimer.fll executes a custom method (oapp.killitcheck) every 10 seconds. When a killit.wrn file is found, the client is given a messagebox asking to quit. When a killit.ded file is found, the cleanup routine is executed., and the client is exited from the app. My cleanup routine is not being working if the client never responded to the original messagebox.
>>>
>>>I am not sure if oapp.killitcheck is not being executed with the messagebox up, or if the killit.ded code is being executed but the program will not QUIT with a messagebox up. Guess I do not understand much about timers or messageboxes. Anyone have any ideas?
>>>
>>>Thanks - Brenda
>
>>Just a thought. You may have your own messagebox with a timer which will close itself and app, instead of system one.
>
>>Nick
>
>how can i attach a timer to a messagebox? or more importantly, how can i programmatically get rid of a messagebox?
>
>also, do you think that my cpptimer is continuing to execute code every 10 seconds, even while the messagebox is up?
>
>thanks - brenda

Brenda, I don't know the way to programmatically close the MESSAGEBOX(), probably there is no any. I think you need to use a modal form with proper buttons instead of MESSAGEBOX(). You can add the timer for it and close the app in the timer event.
Instead of setting really big timer interval you may set the shorter interval and check for
something like:

IF SECONDS() > thisform.SecondsWnenStarted + 300 && (say, 5 min waiting)
oApp.Cleanup()
ENDIF

I am not sure about cpptimer, but VFP timer may be not working for a while, in different conditions, for example when you have the application menu open.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform