What's So Great About Events, Anyway?

If you've ever developed Windows applications the traditional way, without a doubt you'll find the ease of use of Delphi events a welcome alternative to manually catching Windows messages, cracking those messages, and testing for window handles, control IDs, WParam parameters, LParam parameters, and so on. If you don't know what all that means, that's okay; Chapter 3, “Adventures in Messaging,” covers messaging internals.

A Delphi event is often triggered by a Windows message. The OnMouseDown event of a TButton, for example, is really just an encapsulation of the Windows WM_xBUTTONDOWN messages. Notice that the OnMouseDown event gives you information such as which button was pressed and the location of the ...

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.