Board index » cppbuilder » How to send a message to all forms?
Simon Elliott
![]() CBuilder Developer |
How to send a message to all forms?2003-09-18 10:08:26 PM cppbuilder57 I have an application where a menu or button on any of several forms can start a process that may spawn a number of threads. The threads use the TThread class. When the process starts, I'd like to notify all the forms which might execute the process, so that they can disable the menu items which start the process. (Only one instance of the process can be running at any one time.) Obviously I can call methods in all the forms, but I'm fairly sure that will become a maintenance nightmare. When the last thread has stopped, I'd like to notify all the forms so they can re-enable the menus. Currently I use a timer for this, which checks the count of threads running. Is there a better way? -- Simon Elliott www.ctsn.co.uk/ |