Delphi's Message System

VCL handles many of the details of the Windows message system for you. The message loop is built into VCL's Forms unit, for example, so you don't have to worry about fetching messages from the queue or dispatching them to a window procedure. Delphi also places the information located in the Windows TMsg record into a generic TMessage record:

type
  TMessage = record
    Msg: Cardinal;
    case Integer of
      0: (
        WParam: Longint;
        LParam: Longint;
        Result: Longint);
      1: (
        WParamLo: Word;
        WParamHi: Word;
        LParamLo: Word;
        LParamHi: Word;
        ResultLo: Word;
        ResultHi: Word); 
  end;

Notice that TMessage record has a little less information than does TMsg. That's because Delphi internalizes the other TMsg fields; TMessage contains just the essential ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.