next up previous contents
Next: Message loop Up: How to implement a Previous: Introduction   Contents


Windows Message

A Windows message is a record structure that Windows uses to communicate information around between controls, forms, windows, etc. The message structure first has a field called HWnd which is a handle to the window or control that the message is directed to. Next comes the message field which is the actual message type being sent. For a mouse click, the message type would be WM_MOUSEDOWN. Next come two fields for passing message-specific data along with the message. These are named WParam and Lparam, two longint values [6].

type
 TMsg = packed record
  hwnd: HWND;       // the handle of the Window for which the
                    // message is intended
  message: UINT;    // the message constant identifier
  wParam : WPARAM;  // 32 bits of message-specific information
  lParam : LPARAM;  // 32 bits of message-specific information
  time   : DWORD;   // the time that the message was created
  pt     : TPoint;  // Mouse cursor position when the message 
end;                // was created



Tiziano Mengotti 2004-03-27