Callback Functions

A callback function is a function in your application called by Win32 DLLs or other DLLs. Basically, Windows has several API functions that require a callback function. When calling these functions, you pass in an address of a function defined by your application that Windows can call. If you're wondering how this all relates to DLLs, remember that the Win32 API is really several routines exported from system DLLs. Essentially, when you pass a callback function to a Win32 function, you're passing this function to a DLL.

One such function is the EnumWindows() API function, which enumerates through all top-level windows. This function passes the handle of each window in the enumeration to your application-defined callback function. ...

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.