This hook allows the library and procedure loading and deleting calls to be intercepted.
#define INCL_WINHOOKS /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>
HAB hab; /* Anchor-block handle. */
LONG idContext; /* Origin of call to hook. */
PSZ pszLibname; /* Library name. */
PHLIB hlib; /* Pointer to a library handle. */
PSZ pszProcname; /* Procedure name. */
PFNWP wndProc; /* Window procedure identifier. */
PBOOL pfSuccess; /* Success indicator. */
BOOL rc; /* Processing indicator. */
rc = LoaderHook(hab, idContext, pszLibname,
hlib, pszProcname, wndProc, pfSuccess);