Jump to content

WindowDCHook

From EDM2
Revision as of 19:43, 13 April 2025 by Martini (talk | contribs) (Created page with "This hook is called when a device context is allocated or freed. ==Syntax== WindowDCHook(hab, hdc, hwnd, flAssociate); ==Parameters== ;''hab'' (HAB) - input: The application anchor block. ;''hdc'' (HDC) - input: The current device-context handle. ;''hwnd'' (HWND) - input: The current window handle. ;''flAssociate'' (BOOL) - input: Association flag. :TRUE: Device context has been allocated. :FALSE: Device context has been freed. ;''rc'' (BOOL) - returns: Success indica...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This hook is called when a device context is allocated or freed.

Syntax

WindowDCHook(hab, hdc, hwnd, flAssociate);

Parameters

hab (HAB) - input
The application anchor block.
hdc (HDC) - input
The current device-context handle.
hwnd (HWND) - input
The current window handle.
flAssociate (BOOL) - input
Association flag.
TRUE: Device context has been allocated.
FALSE: Device context has been freed.
rc (BOOL) - returns
Success indicator.
TRUE: Successful completion.
FALSE: Errors occurred.

Returns

rc (BOOL) - returns
Success indicator.
TRUE: Successful completion.
FALSE: Errors occurred.

Example Code

#define INCL_WINHOOKS /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HAB  hab;         /* The application anchor block. */
HDC  hdc;         /* The current device-context handle. */
HWND hwnd;        /* The current window handle. */
BOOL flAssociate; /* Association flag. */
BOOL rc;          /* Success indicator. */

rc = WindowDCHook(hab, hdc, hwnd, flAssociate);