xtd 1.0.0
Loading...
Searching...
No Matches
message.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.hpp"
6#include <xtd/object>
7#include <xtd/string>
8#include <cstdint>
9#include <iomanip>
10#include <sstream>
11#include <string>
12
13namespace xtd {
14 namespace forms {
16 class application;
17 class control;
19
33 struct forms_export_ message : xtd::object, xtd::iequatable<message> {
35 message() = default;
37
39
45
49
54
59
63
67 xtd::intptr __handle__ = 0;
69
71
76 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
80 [[nodiscard]] auto equals(const message& other) const noexcept -> bool override;
81
84 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
85
89 template<typename type_t>
90 [[nodiscard]] auto get_lparam() const noexcept -> type_t { return reinterpret_cast<type_t>(lparam); }
91
94 [[nodiscard]] auto to_msg_string() const noexcept -> xtd::string;
95
98 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
100
102
111 [[nodiscard]] static auto create(xtd::intptr hwnd, xtd::uint32 msg, xtd::intptr wparam, xtd::intptr lparam) -> message;
113
114 private:
115 friend class application;
116 friend class control;
118 };
119 }
120}
Provides static methods and properties to manage an application, such as methods to start and stop an...
Definition application.hpp:52
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
auto to_msg_string() const noexcept -> xtd::string
Returns a string that represents the msg property.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
static auto create(xtd::intptr hwnd, xtd::uint32 msg, xtd::intptr wparam, xtd::intptr lparam) -> message
Creates a new message.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto to_string() const noexcept -> xtd::string override
Returns a string that represents the current message.
auto get_lparam() const noexcept -> type_t
Gets the lparam value and converts the value to an object.
Definition message.hpp:90
xtd::intptr result
Gets or sets the value that is returned to Windows in response to handling the message.
Definition message.hpp:62
xtd::intptr hwnd
Gets or sets the window handle of the message.
Definition message.hpp:44
auto equals(const message &other) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
xtd::uint32 msg
Gets or sets the ID number for the message.
Definition message.hpp:48
xtd::intptr wparam
Gets or sets the wparam field of the message.
Definition message.hpp:53
xtd::intptr lparam
Sets the lparam field of the message.
Definition message.hpp:58