TMessageManager = class
class PASCALIMPLEMENTATION TMessageManager : public System::TObject
Manages message dispatching.
TMessageManager is the class in charge with the application's message handling. It defines an object that acts as an application-wide notification center.
You can create many instances of TMessageManager, but this class can also work as a singleton. You can call TMessageManager.DefaultManager to access an instance of TMessageManager instead of instantiating your own instances and keeping track of them.
Once you have an instance of TMessageManager, you can call TMessageManager.SubscribeToMessage to subscribe message-handling methods to specific types of messages. Message-handling methods may be methods of an object or anonymous methods. After you subscribe a method to a type of message, every time there is a call to TMessageManager.SendMessage with a message of the target type, the subscribed method is called.
To unsubscribe a previously-subscribed method from a message type, call TMessageManager.Unsubscribe.
- System.Messaging (Object Pascal) code example
- System.Messaging (C++) code example