Using Messages

From RAD Studio
Jump to: navigation, search

Go Up to VCL Component Writer's Guide Index

In application development, messages are a mechanism of communication between processes.

In your application, messages may come from:

  • The system, which informs your application of user input, painting phases, and other system-wide events.
  • Your application. Different parts of your application use messages to communicate with each other.

When to Use Messages

When you write an application, you usually handle events rather than messages. Components publish events that you can handle, and they only use messages internally (transparently for you), to communicate with other components and handle system messages.

However, you might need to use messages if:

Choosing a Messaging Solution

When you work on a RAD Studio project, there are two different messaging solutions that you may use. When your project is an application, you usually choose the messaging solution that your application framework uses:

If you are writing a custom component, you may use the cross-platform RTL messaging system regardless of the framework that your component uses, FireMonkey or VCL. However, using the Windows API messaging solution on VCL components might be wiser, as existing VCL components only receive and send messages using the Windows API, and the VCL framework does not translate Windows API messages into cross-platform messages as FireMonkey does.


See Also