xtd 0.2.0
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 : object, iequatable<message> {
35 message() = default;
36 message(message&& message) = default;
37 message(const message& message) = default;
38 message& operator =(message&&) = default;
39 message& operator =(const message&) = default;
41
43
49
53
58
63
67
73
75
80 bool equals(const xtd::object& obj) const noexcept override;
84 bool equals(const message& other) const noexcept override;
85
88 xtd::size get_hash_code() const noexcept override;
89
93 template<class type_t>
94 type_t get_lparam() const noexcept { return reinterpret_cast<type_t>(lparam); }
95
98 xtd::string to_msg_string() const noexcept;
99
102 xtd::string to_string() const noexcept override;
104
106
117
118 private:
119 friend class application;
120 friend class control;
122 };
123 }
124}
Provides static methods and properties to manage an application, such as methods to start and stop an...
Definition application.hpp:51
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:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
object()=default
Create a new instance of the ultimate base class object.
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
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
xtd::string to_msg_string() const noexcept
Returns a string that represents the msg property.
bool equals(const message &other) const noexcept override
Determines whether the specified object is equal to the current object.
uint32 msg
Gets or sets the ID number for the message.
Definition message.hpp:52
static message create(intptr hwnd, int32 msg, intptr wparam, intptr lparam)
Creates a new message.
intptr hwnd
Gets or sets the window handle of the message.
Definition message.hpp:48
xtd::string to_string() const noexcept override
Returns a string that represents the current message.
intptr __handle__
Gets or sets the handle field of the message.
Definition message.hpp:71
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
intptr wparam
Gets or sets the wparam field of the message.
Definition message.hpp:57
intptr result
Gets or sets the value that is returned to Windows in response to handling the message.
Definition message.hpp:66
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
intptr lparam
Sets the lparam field of the message.
Definition message.hpp:62
type_t get_lparam() const noexcept
Gets the lparam value and converts the value to an object.
Definition message.hpp:94