MSG Structure

Header File

winuser.h

Interface

Not applicable

Structure Configuration

Not applicable

Syntax


typedef struct tagMSG {
  HWND   hwnd;
  UINT   message;
  WPARAM wParam;
  LPARAM lParam;
  DWORD  time;
  POINT  pt;
  DWORD  lPrivate;
} MSG;
                

Members

hwnd

A handle to the window that is to receive a message. This member is NULL if the message is not attached to a particular window.

message

The message identifier. This parameter can be an implementation-specific message in the range 0xC000 through 0xFFFF. Standard Windows messages are in the range 0x0001 through 0x0400.

wParam

Additional message information. The precise meaning of this parameter depends on the value of the message parameter.

lParam

Additional message information. The precise meaning of this parameter depends on the value of the message parameter.

time

The time when the message was posted.

pt

The cursor position, in screen coordinates, when the message was posted.

lPrivate

Not used. For internal use only.

Remarks

The MSG structure contains message information from a thread's message queue.

When a thread creates one or more windows, the system creates a message queue for the thread. When the thread calls GetMessage or PeekMessage, the system retrieves messages from the queue and places them in the MSG structure.

The wParam and lParam members specify the message and its parameters. The meanings of these parameters depend on the type of the message.