xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
xtd::forms::imessage_filter Class Referenceabstract

Defines a message filter interface. More...

#include <imessage_filter.hpp>

Public Member Functions

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

Detailed Description

Defines a message filter interface.

Remarks
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.

Member Function Documentation

§ pre_filter_message()

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

Filters out a message before it is dispatched.

Parameters
mThe message to be dispatched. You cannot modify this message.
Returns
true to filter the message and stop it from being dispatched; false to allow the message to continue to the next filter or control.
Remarks
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: