A detailed list of messages in Windows

Source: Internet
Author: User
Tags constant

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.