Jump to content

DestroyWindowHook: Difference between revisions

From EDM2
Created page with "This hook is called whenever a window is destroyed. ==Syntax== DestroyWindowHook(hab, hwnd, ulReserved); ==Parameters== ;''hab'' (HAB) - input: Anchor-block handle. ;''hwnd'' (HWND) - input: The handle of the window being destroyed. ;''ulReserved'' (ULONG) - input: Reserved. ==Returns== ;''rc'' (BOOL) - returns: Success indicator. :TRUE: Successful completion :FALSE: Error occurred. ==Remarks== This hook is sent after the WM_DESTROY message has been sent and jus..."
 
Ak120 (talk | contribs)
 
Line 16: Line 16:
==Remarks==
==Remarks==
This hook is sent after the [[WM_DESTROY]] message has been sent and just before the window becomes invalid.
This hook is sent after the [[WM_DESTROY]] message has been sent and just before the window becomes invalid.
==Related Messages==
* [[WM_DESTROY]]


==Example Code==
==Example Code==

Latest revision as of 17:18, 26 October 2025

This hook is called whenever a window is destroyed.

Syntax

DestroyWindowHook(hab, hwnd, ulReserved);

Parameters

hab (HAB) - input
Anchor-block handle.
hwnd (HWND) - input
The handle of the window being destroyed.
ulReserved (ULONG) - input
Reserved.

Returns

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

Remarks

This hook is sent after the WM_DESTROY message has been sent and just before the window becomes invalid.

Example Code

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

HAB     hab;        /* Anchor-block handle. */
HWND    hwnd;       /* The handle of the window being destroyed. */
ULONG   ulReserved; /* Reserved. */
BOOL    rc;         /* Success indicator. */

rc = DestroyWindowHook(hab, hwnd, ulReserved);