Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Relational Databases
Expertise: Beginner
Mar 19, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Abort DialogBox using Delphi 2.0 on NT 3.51

I created a simple abort dialog box with one button. During a long query I want to display my box so the user can abort. The dialog box creates a thread to monitor for the Abort button event. However the dialog box does not respond to any mouse events. How can I detect when the Abort button has been pressed?

If you're running the query in a thread, then you can kill the thread with a call to TerminateThread, which is a Windows API call. However, you should note that it may be a bit dangerous to do this because the BDE will have open cursors to the tables that it's accessing at the time. Your only other recourse would be to abort the thread in between queries after you've freed the BDE resources. If it's a single query, then that means going into the BDE, and that can be a complicated matter. I suggest you get a book on BDE-level programming.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date