Ian Branch 127 Posted February 2 Hi Team, Books have been written about what I don't know about threading... 😉 I have experimented with Anonympus threads. Is it possible to prevent the App doing anything except being moved, and parhas resized, while a thread is running? Regards & TIA, Ian Share this post Link to post
Remy Lebeau 1396 Posted February 2 Anything is possible, yes. You are going to have to be more specific about your particular situation. Â It sounds like you just want to disable your UI while the thread is running. But then why use a thread at all? Share this post Link to post
Ian Branch 127 Posted February 2 (edited) 35 minutes ago, Remy Lebeau said: But then why use a thread at all? Because I still want them to be able to move and resize the App/Form while the thread is running. If I do it in the main thread the form becomes unresponsive. Edited February 2 by Ian Branch Share this post Link to post
PeaShooter_OMO 11 Posted February 2 (edited) -- Edited February 2 by PeaShooter_OMO Share this post Link to post
Lars Fosdal 1792 Posted February 2 The challenge is often identifying all the ways that an app can activate stuff while the thread is executing. You could f.x. have a busy flag (or set of flags) you set when you start the thread, and clear on completion, so that when a user opens a menu you can use the flag(s) to disable menu and buttons items that can't be used while the thread is running.  Share this post Link to post
PeterBelow 238 Posted February 2 5 hours ago, Ian Branch said: Hi Team, Books have been written about what I don't know about threading... 😉 I have experimented with Anonympus threads. Is it possible to prevent the App doing anything except being moved, and parhas resized, while a thread is running? Regards & TIA, Ian Put all controls on the form on a client-aligned panel and then simply disable the panel while the background thread is active. Also use a handler for the OnCloseQuery event to prevent closing of the app while the thread is running. If you have a main menu bar tie all menu items to actions and disable the actionlist while the thread is running. Just don't forget to enable all the stuff again when the thread is done. 4 Share this post Link to post