xtd - Reference Guide 0.2.0
xtd::forms::imessage_filter Class Referenceabstract

#include <imessage_filter.h>


Defines a message filter interface.

This interface allows an application to capture a message before it is dispatched to a control or form.
A class that implements the imessage_filter interface can be added to the application's message pump to filter out a message or perform other operations before the message is dispatched to a form or control. To add the message filter to an application's message pump, use the add_message_filter method in the application class.


virtual bool pre_filter_message (const message &m)=0
 Filters out a message before it is dispatched. More...

Member Function Documentation

◆ pre_filter_message()

virtual bool xtd::forms::imessage_filter::pre_filter_message ( const message m)
pure virtual

Filters out a message before it is dispatched.

mThe message to be dispatched. You cannot modify this message.
true to filter the message and stop it from being dispatched; false to allow the message to continue to the next filter or control.
Use pre_filter_message to filter out a message before it is dispatched to a control or form. For example, to stop the click event of a button control from being dispatched to the control, you implement the pre_filter_message method and return a true value when the click message occurs. You can also use this method to perform code work that you might need to do before the message is dispatched.

The documentation for this class was generated from the following file: