Types of Messages
The Win32 API predefines a constant for each Windows message. These constants are the values kept in the message field of the TMsg record. All these constants are defined in Delphi's Messages unit; most are also described in the online help. Notice that each of these constants begins with the letters WM, which stand for Windows Message. Table 3.1 lists some of the common Windows messages, along with their meanings and values.
Table 3.1 Common Windows Messages
Message Identifier |
Value |
Tells a Window That. . . |
Wm_Activate |
$00l6 |
It's being activated or deactivated. |
wm_Char |
$0102 |
wm_KeyDown and wm_KeyUp messages have been sent for one key. |
wm_Close |
$0010 |
It should terminate. |
wm_KeyDown |
$0100 |
A keyboard key is being pressed. |
wm_KeyUp |
$0101 |
A keyboard key has been released. |
wm_LButtonDown |
$0201 |
The user is pressing the left mouse button. |
wm_MouseMove |
$0200 |
The mouse is being moved. |
WM_PAINT |
$000F |
It must repaint its client area. |
wm_Timer |
$0113 |
A timer event has occurred. |
wm_Quit |
$0012 |
A request has been made to shut down the program. |