Events

EHLLAPI provides some means for an application to receive asynchronous notification of certain events. However, the event models are not consistent (some events use semaphores, others use window system messages), and the application is responsible for setting up and managing the event threads. The HACL simplifies all the event handling and makes it consistent for all event types. The application does not have to explicitly create multiple threads of execution, the HACL takes care of the threading internally.

However, you must be aware that the event procedures are called on a separate thread of execution. Access to dynamic application data must be synchronized when accessed from an event procedure. The event thread is spawned when the application registers for the event, and is terminated when the event is unregistered.