WinSetClassThunkProc
Appearance
This function associates a pointer-conversion procedure with a window class.
Syntax
WinSetClassThunkProc(pszClassName, pfnThunkProc)
Parameters
- pszClassName (PSZ) - input
- Window-class name.
- pfnThunkProc (PFN) - input
- Pointer-conversion procedure identifier.
- NULL
- Any existing pointer-conversion procedure is dissociated from this class.
- By default, a class has no pointer-conversion procedure associated with it.
- Other
- The pointer-conversion procedure to be associated with this class.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- An error occurred.
Remarks
This function does not alter the pointer-conversion procedure associated with any existing window. It changes the pointer-conversion procedure that will be associated with a window created with a subsequent WinCreateWindow or WinCreateStdWindow function.
Example Code
This example sets the pointer conversion procedure of the window class, given that we have an anchor-block handle.
#define INCL_WINWINDOWMGR
#define INCL_WINTHUNKAPI
#include <OS2.H>
LONG thunkpr(LONG *p); /* prototype definition. */
main()
{
HAB hab;
PFN pfn;
char *classname;
WinQueryClassName(hab,
sizeof(classname),
classname);
WinSetClassThunkProc(classname,
(PFN)thunkpr);
}
LONG thunkpr(LONG *p)
{
/* 16-bit to 32-bit pointer conversion procedure. */
}
Definition
#define INCL_WINTHUNKAPI /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> PSZ pszClassName; /* Window-class name. */ PFN pfnThunkProc; /* Pointer-conversion procedure identifier. */ BOOL rc; /* Success indicator. */ rc = WinSetClassThunkProc(pszClassName, pfnThunkProc);