This hook is called whenever a window is destroyed.
#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);