Message refers to a notification from Windows telling the application that something has happened. For example, clicking a mouse, changing the window size, and pressing a key on the keyboard will cause Windows to send a message to the application.
The message itself is passed as a record to the application, which contains the type of message and other information. For example, for a message that is generated by a mouse click, the record contains the coordinates of the mouse click. This record type is called Tmsg, which is declared in the Windows unit:
Type
tmsg = Packed record
Hwnd:hwnd; Window handle
Message:uint; Message constant identifier
Wparam:wparam; Specific additional information for 32-bit messages
Lparam:lparam; Specific additional information for 32-bit messages
Time:dword; Time when the message was created
Pt:tpoint; The mouse position at the time the message was created
End
What's in the message? Do you think the information in a message record is like Greek? If so, take a look at the following explanations:
The HWND 32-bit window handle. A window can be any type of screen object, because Win32 can maintain the handles of most visual objects (Windows, dialog boxes, buttons, edit boxes, and so on).
The message is used to distinguish constant values from other messages, which can be predefined constants in Windows cells or custom constants.
WParam is usually a constant value that is related to a message, or it may be a handle to a window or control.
LParam is usually a pointer to data in memory. Because wparam, lparam, and pointer are 3 2-bit, they can be converted to each other.
Wm_null = $0000;
Wm_create = $0001; The application creates a window
Wm_destroy = $0002; A window is destroyed
Wm_move = $0003; Move a window
Wm_size = $0005; Change the size of a window
Wm_activate = $0006; A window is activated or inactive;