The device context hook is called when a device context is allocated or freed. The following code shows the syntax for a device context hook function:

BOOL EXPENTRY WindowDCHook(HAB  hab,
                           HDC  hdc,
                           HWND hwnd,
                           BOOL flAssociate);

The hab parameter is the application anchor block.

The hdc parameter is the current device-context handle.

The hwnd parameter is the current window handle.

The flAssociate parameter is the association flag and is either TRUE or FALSE. If TRUE, the device context has been allocated. If FALSE, the device context has been freed.

This function returns either TRUE (success) or FALSE (error).


[Back] [Next]