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
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
48 intptr hwnd = 0;
49
52 uint32 msg = 0;
53
57 intptr wparam = 0;
58
62 intptr lparam = 0;
63
66 intptr result = 0;
67
71 intptr __handle__ = 0;
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
115 static message create(intptr hwnd, int32 msg, intptr wparam, intptr lparam);
117
118 private:
119 friend class application;
120 friend class control;
121 message(intptr hwnd, int32 msg, intptr wparam, intptr lparam, intptr result, intptr handle);
122 };
123 }
124}
Represents text as a sequence of character units.
Definition basic_string.hpp:71
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:43
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
@ control
The left or right CTRL modifier key.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Implements a Windows message.
Definition message.hpp:33
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.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.